IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Calling a RDBMS Web Service Made in XML GAteways with C#

    Posted Wed December 27, 2006 06:00 PM

    Hi We made some Web Services using XML GATEWAYS using the RDBMS adapter.

    The Web Services are target Webservices because they only update or insert information.

    But we can not call those web services using C#.

    Can anyone helpus with this.

    Thanks a lot.

    Carlos


    #Mainframe-Integration
    #webMethods
    #EntireX


  • 2.  RE: Calling a RDBMS Web Service Made in XML GAteways with C#

    Posted Thu December 28, 2006 08:31 AM

    Hi Carlos,

    “Unable to call from C#” is a very general statement.

    If you could post the error you receive I could probably say more.

    To cover some of the more common errors you should know the following:

    The XML Gateways SOAP interface is based on the AXIS engine from Apache so you should make sure of that the C# client adds a SOAPAction to the HTTP header. AXIS is very dependent on this.

    The XML Gateways supports MIME but not DIME (a favorite of Microsoft). Make sure your client is creating MIME formatted messages.

    Regards,


    #Mainframe-Integration
    #EntireX
    #webMethods


  • 3.  RE: Calling a RDBMS Web Service Made in XML GAteways with C#

    Posted Thu December 28, 2006 03:32 PM

    Hi Matthew

    Thanks for your answer.

    I will send you the C# code that invokes the web service and the WSDL of the web service.

    The error is that the Web service do get to be called.

    If a try to executed via HTTP i get the following errors

    Execute
    http://meganeii:8080/fraxis/services/WS_SP_SAGPRIORIZARDIFERIDO?method=MessageDefinition&NUMPEDTOPAS=W00025&FRANQUICIA=B
    javax.resource.ResourceException: invalid next child “‘FRANQUICIA’ (no namespace URI)” for row MessageDefinition expected name to be: ‘NUMPEDTOPAS’ (no namespace URI); nested exception is:
    com.softwareag.fresno.base.document.DocumentException

    Execute
    http://meganeii:8080/fraxis/services/WS_SP_SAGPRIORIZARDIFERIDO?method=MessageDefinition&NUMPEDTOPAS=W00025

    javax.resource.ResourceException: StmtMapField.setObject Field Number <2> - null input value for required parameter.; nested exception is:
    com.softwareag.fresno.resourceadapter.managed.ManagedAdapterException: StmtMapField.setObject Field Number <2> - null input value for required parameter.

    We try to do this because we want to executed using HTTP, because the SOAPCLient in C# dont work.

    Thanks a lot for your help.

    Carlos
    Webservice.zip (1.65 KB)


    #webMethods
    #Mainframe-Integration
    #EntireX


  • 4.  RE: Calling a RDBMS Web Service Made in XML GAteways with C#

    Posted Mon January 15, 2007 05:53 PM

    Hi Carlos,

    Being the inexperienced c# programmers we are, we are still looking for a way for you to call the Web Service using c#.

    In the meantime, it is probably also helpful for you to know that you the way you are calling the web service is not supported. From the logs posted so far, it looks like you are using the http get method, placing the information required by the Web Service in the request URL.

    The Web Service is expecting a document literal SOAP message however which should be "post"ed to the URL of the service.

    I don’t have a complete Visual Studio installed at this time so it might take a while to get you an example of how it should work…

    If I have the chance to do this, I’ll let you know.

    Regards,


    #Mainframe-Integration
    #EntireX
    #webMethods


  • 5.  RE: Calling a RDBMS Web Service Made in XML GAteways with C#

    Posted Tue January 16, 2007 01:53 PM

    Hi Carlos,

    We were able to create a c# program that calls a document literal style web service without too many problems.

    The c# program is actually quite simple but requires that you add the wsdl file of your web service to integrate as a WebReference in you c# project.

    To get your web service call working, you should begin by creating a C# Console Application Project (called Example below). Once that is done, add your web service as a WebReference to the project.

    Once the WebReference is added you can then write the c# program to call your service. In the following example, I used a web service URL of http://pcmaga5/services/EELIB?wsdl to import the Web Reference.

    using System;
    using System.Collections.Generic;
    using System.Text;

    namespace Example
    {
    class Program
    {
    static void Main(string args)
    {

            pcmaga5.EELIB ee = new pcmaga5.EELIB();
    
    pcmaga5.EEODEN01 eeoden = new pcmaga5.EEODEN01();
    
    eeoden.ENGLISHNAME = "Jonathan"; 
    
    ee.Enquiry(eeoden);
    
    Console.WriteLine(eeoden);
    }
    }
    

    }

    All this does is create an instance of the Service and operation. It then sets the value of one of the XML nodes to Jonathan and sends it.

    I hope this helps you some.

    Kind Regards,


    #Mainframe-Integration
    #EntireX
    #webMethods


  • 6.  RE: Calling a RDBMS Web Service Made in XML GAteways with C#

    Posted Wed January 24, 2007 06:45 PM

    Hi i was able to create adapt the proxy class generated by Visual Studio to call the Web Service the XML Gateways had generate.

    Here is the source code.

    Thanks for all your help and i hope this can help others to.

    Regards

    Carlos Abad

    using System.Diagnostics;
    using System.Xml.Serialization;
    using System;
    using System.Web.Services.Protocols;
    using System.ComponentModel;
    using System.Web.Services;
    using System.Configuration;

    ///
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute(“code”)]
    [System.Web.Services.WebServiceBindingAttribute(Name=“WS_SP_SAGPRIORIZARDIFERIDOSoapBinding”, Namespace=“”)]
    public class PriorizarDiferidoT : System.Web.Services.Protocols.SoapHttpClientProtocol
    {

    /// <remarks/>
    public PriorizarDiferidoT() 
    {
    //this.Url = "http://meganeii:8080/fraxis/services/WS_SP_SAGPRIORIZARDIFERIDO";
    this.Url=ConfigurationSettings.AppSettings["urlWS"];
    }
    
    /// <remarks/>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("MessageDefinition", Namespace="")]
    public object MessageDefinition(string NUMPEDTOPAS, string FRANQUICIA, string REFERENCIA) 
    {
    object[] results = this.Invoke("MessageDefinition", new object[] {NUMPEDTOPAS,FRANQUICIA,REFERENCIA});
    return ((object)(results[0]));
    }  
    /// <remarks/>
    public System.IAsyncResult BeginProcessDocument(object ProcessDocument1, System.AsyncCallback callback, object asyncState) 
    {
    return this.BeginInvoke("ProcessDocument", new object[] {
    ProcessDocument1}, callback, asyncState);
    }
    
    /// <remarks/>
    public object EndProcessDocument(System.IAsyncResult asyncResult) 
    {
    object[] results = this.EndInvoke(asyncResult);
    return ((object)(results[0]));
    }
    

    }


    #webMethods
    #Mainframe-Integration
    #EntireX