Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Consume Business Service in .NET

  1. #1

    Consume Business Service in .NET

    Hello all,

    I'm trying to consume a simple service in .Net and I can not get the correct response. I have successfully deploy my BSSV Server on WLS, enable SSL and tested it with SOAPUI and it works.

    After that I have created a simple .net project setup my web reference. In order to insert the custom soap header i have created an soap extension. But I get

    [ QUOTE ]
    SOAP header Security was not undestood

    [/ QUOTE ]

    When I looked at the return stream it is the exact string returned by SOAP ui. Any info will be of great help.

    Thanx,
    Alex.

    E910 Tools 9.1.0.5
    Oracle Linux 5 with Oracle 11g
    WLS 11g

  2. #2

    Re: Consume Business Service in .NET

    After some research I have finally managed to consume my service.

    Here is what I've done:

    -Added Microsoft.web.services3.dll reference
    -Modified the generated proxy to derive from Microsoft.web.services3.WebServicesClientProtocol instead of System.Web.Services.Protocols.SoapHttpClientProtoc ol
    -Add a UsernameToken to the SoapContext of the Proxy.

    and that's it.

    Hope someone will find this useful.

    Cheers,
    Alex.
    E910 Tools 9.1.0.5
    Oracle Linux 5 with Oracle 11g
    WLS 11g

  3. #3
    New Member
    Join Date
    May 2008
    Posts
    16

    Re: Consume Business Service in .NET

    Hello Alex,

    I am having the same scenario. Trying to call business service deployed to WAS bssv server from a .NET web application.
    I don't know how to change the soap header. kindly can you provide me with the steps required to call a JDE service from a .NET project. and how to include the user name and password in the SOAP message.

    Thanks
    Anan

  4. #4

    Re: Consume Business Service in .NET

    I know this thread is old, but I just had the same problem and searched some time until I found it, so here is the answer:
    The webreferences in Visual studio creates a "Reference.cs" in which you have to change the line
    "public partial class RI_AddressBookManager : System.Web.Services.Protocols.SoapHttpClientProtoc ol {"
    into
    "public partial class RI_AddressBookManager : Microsoft.Web.Services2.WebServicesClientProtocol {"

    After this a c# code like this should work:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Web.Services.Protocols;
    using webserviceJDE.AddressBookManager; //the webreference
    using System.Web.Services;
    using Microsoft.Web.Services2.Security.Tokens; //Microsoft WSE 2.0 SP2
    using System.Net;


    namespace webserviceJDE
    {
    class Program
    {
    static void Main(string[] args)
    {
    string username = "jde";
    string password = "jde";
    UsernameToken ut = new UsernameToken(username, password, PasswordOption.SendPlainText); //Create Security token...

    RI_AddressBookManager abm = new RI_AddressBookManager();//RI_AddressBookManager();
    NetworkCredential myCred = new NetworkCredential(username, password);
    abm.RequestSoapContext.Security.Tokens.Add(ut);
    RI_GetAddressBook a = new RI_GetAddressBook();//Selection Parameters
    a.entityTypeCode = "E"; //just look for employees
    RI_ShowAddressBook S = abm.getAddressBook(a);
    if (S != null)
    {
    foreach (RI_AddressBook ab in S.addressBook)
    {
    Console.WriteLine(ab.entityName);
    }
    }


    }
    }
    }

    Thanks go to Carsten in Thread#143808 who uploaded a "HowTo call secured JDE WebServices using jdeveloper or MS
    VS2005"

    Hope that will help others to save some time...

    Regards,
    Florian

  5. #5

    Re: Consume Business Service in .NET

    additional hint:
    when using SSL (https://) to contact the webservice, you have to add two lines of code before calling the wenservice:
    abm.Url = "http<font color="red">s </font>://&lt;server&gt;/webservicename";
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

    The first changes from http to https and the second changes the protocol from TLS to SSL3 which is used by JAVA-based webservices.
    Unfortunately I could not find a way how to add the webreference using https because VisualStudio 2010 (and versions before) seem to have no option to change the security protocol.

  6. #6

    Re: Consume Business Service in .NET

    Does anyone have a fully-operational example of consuming a business service in .NET/C#/VS2010? It would seem that many of the suggestions in this thread are no longer applicable as VS2010 does not support WSE (any version).

    I have access to the WSDL and have setup a "service reference" within the VS2010 solution/project, but it is not operational at all. I assume it has something to do with authentication, but...?

    Thanks in advance for any assistance!

    Lynn

  7. #7
    New Member
    Join Date
    Jan 2013
    Posts
    6

    Re: Consume Business Service in .NET

    Hi,
    I have tested the code below but the error message that I keep getting is "can not connect to remote server".

    Any advice?




    End Sub

    Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim username As String = "jde"
    Dim password As String = "jde"
    Dim ut As New UsernameToken(username, password, PasswordOption.SendPlainText)
    ' Create Security token...
    Dim abm As New RI_AddressBookManager()
    abm.RequestSoapContext.Security.Tokens.Add(ut)
    Dim a As New RI_GetAddressBook()
    'Selection Parameters
    a.entityTypeCode = "C"
    'just look for customers
    Dim en As New RI_Entity()
    en.entityId = 1145
    'select Customer 1145
    a.entity = en
    textBox1.Text = ""
    textBox2.Text = "Calling Webservice..."
    ' textBox2.Refresh()
    Try
    Dim S As RI_ShowAddressBook = abm.getAddressBook(a)
    If S IsNot Nothing Then
    For Each ab As RI_AddressBook In S.addressBook
    TextBox1.Text += ab.EntityName & "; "
    Next
    End If
    TextBox2.Text = "Success!"
    Catch ex As Exception
    TextBox2.Text = (ex.Message & vbLf & vbLf) + ex.StackTrace
    End Try
    End Sub

    End ClassImports System
    Imports System.Collections.Generic
    Imports System.Linq
    Imports System.Text
    Imports System.Web.Services.Protocols
    'Imports webserviceJDE '.AddressBookManager
    Imports System.Web.Services
    Imports Microsoft.Web.Services3.Security.Tokens
    Imports Microsoft.Web.Services3
    'Imports wse_Test.RI_AB.RI_AddressBookManagerHttpPortClient


    Imports System.Net
    Imports wse_Test.RI_AB


    Public Class _Default
    Inherits System.Web.UI.Page

    Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


    Dim username As String = "jde"
    Dim password As String = "jde"
    Dim ut As New UsernameToken(username, password, PasswordOption.SendPlainText) '; //Create Security token...

    Dim abm As New RI_AddressBookManager() ';//RI_AddressBookManager();
    Dim myCred As New NetworkCredential(username, password)

    abm.RequestSoapContext.Security.Tokens.Add(ut)

    Dim a As New RI_GetAddressBook() ';//Selection Parameters

    a.EntityTypeCode = "E" '; //just look for employees
    Dim S As RI_ShowAddressBook = abm.getAddressBook(a)
    If (S.ToString &lt;&gt; "") Then

    Dim ab As RI_AddressBook
    ' While (ab = S.AddressBook)

    MsgBox(ab.EntityName)

    ' End While
    End If

    End Sub
    End Class

  8. #8

    Re: Consume Business Service in .NET

    Not sure about VS2010, but with VS2013, I was unable to fully create the web reference in my website -- it didn't generate the "reference.vb" file. To get around this I created a "Class Application" (aka DLL file). In this project, I was able to successfully generate the web references with the "reference.vb" file, and then alter the "reference.vb" file with Microsoft.Web.Services2 as mentioned in previous posts.

    After building this project (which creates a DLL), I imported the DLL into my website project.

    I'm getting a few other errors now when making calls, but it looks like I made it past step 1


    -Randy

  9. #9
    Hi all,

    This is my first post to the community so please be kind

    I was tasked to create a .NET client to consume these WSDLs:
    //http://xxx.x.x.xxx:yyyy/DV910/AddressBookManager?wsdl
    //http://xxx.x.x.xxx:yyyy/DV910/CustomerManager?wsdl

    I have scoured the usual online resources and could not find any helpful/current examples for Visual Studio 2015 C#.
    Here are some links that I did find but are not useful as they are too old (VS2005!) or rely on JDE specific tools.

    o http://sofb.developer-works.com/arti...d)+Web+service
    o https://www.google.com/webhp?sourcei...0bssv%20vs2015

    Should this be a WCF, WebAPI, or standard Class Library project?

    I have added the "Web Reference" to a Class Library (Add Service Ref->Advanced->Add Web Ref) but am stuck with simple things like how to create an ICredentials object to log in - and after that ?????

    I have created a WCF but am drowned out by the amount of coding overhead (first WCF for ME!!) and have lost track of the forest through the trees

    What I'm really looking for is documentation of a shell project that:
    1) adds the JDE WSDL web reference (URL)
    2) gives an example for connecting to the service (login/auth)
    3) calls a method on the jde object (getCustomerV2) with a parameter
    4) process the result in some sort of meaningful way

    here is an example of the type of code I'm loooking for ... just for VS2015 (the following code uses Microsoft WSE 2.0 SP2 which is not current)

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Web.Services.Protocols;
    using JDEWebService.JDE_AddBookMgr_WebReference; //the webreference
    using System.Web.Services;
    using Microsoft.Web.Services2.Security.Tokens; //Microsoft WSE 2.0 SP2
    using System.Net;




    namespace webserviceJDE
    {
    class Program
    {
    static void Main(string[] args)
    {
    string username = "jde";
    string password = "jde";
    UsernameToken ut = new UsernameToken(username, password, PasswordOption.SendPlainText); //Create Security token...


    RI_AddressBookManager abm = new RI_AddressBookManager();//RI_AddressBookManager();
    NetworkCredential myCred = new NetworkCredential(username, password);
    abm.RequestSoapContext.Security.Tokens.Add(ut);
    RI_GetAddressBook a = new RI_GetAddressBook();//Selection Parameters
    a.entityTypeCode = "E"; //just look for employees
    RI_ShowAddressBook S = abm.getAddressBook(a);
    if (S != null)
    {
    foreach (RI_AddressBook ab in S.addressBook)
    {
    Console.WriteLine(ab.entityName);
    }
    }




    }
    }
    }

    Here is my attempt:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Net;
    using JDEWebService.JDE_CustMgr_WebReference;
    using JDEWebService.Properties;


    namespace JDEWebService
    {
    public class JDEWebService
    {
    public string TEST()
    {
    ICredentials credentials = new NetworkCredential("JDEWBSRVC", "BSSV42#T");
    getCustomerV2 customer = new getCustomerV2();


    using (CustomerManagerService service = new CustomerManagerService())
    {
    service.Credentials = credentials;
    service.getCustomerV2(customer);
    }
    return "done";
    }


    }
    }

    Any and all suggestions would be greatly appreciated.
    ty - marcus

  10. #10
    Hi - were you able do this? I am trying to do the same in VB.net. VS2015 and JDE9.1.5.2 Appreciate your help.
    Last edited by Jde Kumar; 04-21-2017 at 06:51 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
The legal restrictions and terms of use applicable to this site are available here.
Use of this site signifies your agreement to the terms of use.
JDELIST is NOT affiliated with JD Edwards® & Company, Oracle or Peoplesoft. Contents of this site are neither endorsed nor approved by JD Edwards® & Company, Oracle or Peoplesoft.