Nusoap don't generate correct XML (on SAP/J2E

Help
Dimas
2009-03-24
2013-06-06
  • Dimas

    Dimas - 2009-03-24

    Hi,

    I'm trying to use a method of a SAP Web Service using NuSoap library. I'm using the same code I wrote in other applications with Axis Web Services, but it doesn't work with SAP WS (J2EE WS).

    It seems that Nusoap don't generate a correct XML. Doing tests with 'soapUI' the web service works and I can do requests. With 'soapUI' the XML sended is:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ass="http://argos.gencat.intranet/xi/assistencial">
       <soapenv:Header/>
       <soapenv:Body>
          <ass:MT_INT059_ZASICSWSFM001v1>
             <CENTRE>GT</CENTRE>
             <APELLIDO1>SERRA</APELLIDO1>
             <IT_DATOSPAC_O/>
             <IT_RETURN/>
          </ass:MT_INT059_ZASICSWSFM001v1>
       </soapenv:Body>
    </soapenv:Envelope>

    And the request works. But with phpNusoap the XML generated is:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns5083="http://tempuri.org">
    <SOAP-ENV:Body>
      <MT_INT059_ZASICSWSFM001v1 xmlns="">
       <CENTRE xmlns="">GT</CENTRE>
       <APELLIDO1 xmlns="">SERRA</APELLIDO1>
      </MT_INT059_ZASICSWSFM001v1>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    And returns this server error:

    Array
    (
        [faultcode] => SOAP:Server
        [faultstring] => Server Error
        [detail] => Array
            (
                [SystemError] => Array
                    (
                        [context] => XIAdapter
                        [code] => ADAPTER.JAVA_EXCEPTION
                        [text] =>
    com.sap.aii.af.ra.ms.api.DeliveryException: XIServer:NO_RECEIVER_CASE_BE:
        at com.sap.aii.adapter.xi.ms.XIEventHandler.onTransmit(XIEventHandler.java:455)
        at com.sap.aii.af.ra.ms.impl.core.queue.consumer.CallConsumer.onMessage(CallConsumer.java:134)
        at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:917)
        at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)
        at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
        at java.security.AccessController.doPrivileged(AccessController.java:215)
        at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
        at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
             
                    )

            )

    )

    The PHP code used is:

    $client = new nusoap_client('http://zeus/sap/MI_INT059_enviaConsultaWS001v1_os.wsdl', 'wsdl');
    $client->setCredentials("ws_trueta","test");
    $param = array('CENTRE' => 'GT', 'APELLIDO1' => 'SERRA');
    $result = $client->call('MI_INT059_enviaConsultaWS001v1_os', array($param));

    Maybe someone can help me? :(

     
    • Dimas

      Dimas - 2009-03-25

      Nobody? :/

       
    • Karl3i

      Karl3i - 2009-03-25

      If you analyse your generated request:

      <SOAP-ENV:Body>
      <MT_INT059_ZASICSWSFM001v1 xmlns="">
      <CENTRE xmlns="">GT</CENTRE>
      <APELLIDO1 xmlns="">SERRA</APELLIDO1>
      </MT_INT059_ZASICSWSFM001v1>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      it is clear that namespace uri is missing (see xmlns="").
      So I guess nuSOAP is not guilty, but the way you are using nuSOAP is not exactly the good one...

       
      • Dimas

        Dimas - 2009-03-27

        I've pasted the PHP code that use the Nusoap library. You can view there a bad using of nuSOAP?

         
    • seaan

      seaan - 2009-05-26

      Try using "soapval" when building the request (see nuSoap docs for help on methods):

      //1st argument is the XML item name
      //2nd is the name of the type (as per the xsd file, can't tell from your example, i'll leave it blank)
      //3rd is the value of the item
      //4th is the type's namespace
      //5th is the value namespace (if any)
      //6th is an array of attributes (if any)

      $centre = new soapval ('CENTRE','','GT','http://argos.gencat.intranet/xi/assistencial',false,false);
      $appellido1= new soapval ('APPELLIDO1','','SERRA','http://argos.gencat.intranet/xi/assistencial',false,false);
      $itdat= new soapval ('IT_DATOSPAC_O','','','http://argos.gencat.intranet/xi/assistencial',false,false);
      $itret= new soapval ('IT_RETURN','','','http://argos.gencat.intranet/xi/assistencial',false,false);

      $req_obj= new soapval('MT_INT059_ZASICSWSFM001v1','',array($centre,$appellido1,$itdat,$itret),'http://argos.gencat.intranet/xi/assistencial',false,false)

      $req=$req_obj->serialize('literal');
      $result = $client->call('MI_INT059_enviaConsultaWS001v1_os',$req);

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks