NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Problem consuming SAP-XI webservice


Joined: 28 Nov 2008
Posts: 4
Reply with quote
Hi there! I'm having some trouble generating dynamically the associative array used on the call function.

Here is the XML i need to send:

Code:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:bsa:bsanet">
<soapenv:Header/>
<soapenv:Body>
<urn:CrearReserva>
<usuario>PRUEBA</usuario>
<sistema>BSANET</sistema>
<destinatario>Juan</destinatario>
<!--1 or more repetitions:-->
<pos_reservas>
<centro_coste>1EMH330404</centro_coste>
<material>100000030</material>
<almacen>MAGC</almacen>
<cantidad>2</cantidad>
</pos_reservas>
<pos_reservas>
<centro_coste>1EMH133010</centro_coste>
<material>10000023</material>
<almacen>MAGC</almacen>
<cantidad>3</cantidad>
</pos_reservas>
<pos_reservas>
<centro_coste>1EMH330404</centro_coste>
<material>10000023</material>
<almacen>MAGC</almacen>
<cantidad>2</cantidad>
</pos_reservas>
</urn:CrearReserva>
</soapenv:Body>
</soapenv:Envelope>


I managed to send it statically using this coding in PHP at my client side:
Code:

require_once('../recursos/lib/nusoap.php');
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$useCURL = isset($_POST['usecurl']) ? $_POST['usecurl'] : '0';
$client = new nusoap_client("http://benelus:50100/XISOAPAdapter/MessageServlet?channel=:BSANET_DEV:bsanet_CrearReserva_SOAP_Client&amp;version=3.0", false,
                  $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
   echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
   echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
   exit();
}
$client->setCredentials("xi_bsanet","xi_bsanet");
$client->setUseCurl($useCURL);

$params = array(
    'usuario' => "PRUEBA",
    'sistema'         => 'BSANET',
    'destinatario'         => 'Juan',
    'pos_reservas' => new soapval('pos_reservas','pos_reservas',array ('centro_coste' => '1EMH330404','material' => '10000486','almacen' => 'MAGC','cantidad' => '2'),false,''),new soapval('pos_reservas','pos_reservas',array('centro_coste' => '1EMH330404','material' => '10000485','almacen' => 'MAGC','cantidad' => '5'),false,'')
);

$result = $client->call('CrearReserva', $params, 'urn:bsa:bsanet', 'urn:bsa:bsanet');

if ($client->fault) {
   echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>';
} else {
   $err = $client->getError();
   if ($err) {
      echo '<h2>Error</h2><pre>' . $err . '</pre>';
   } else {
      echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
   }
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';


My problem is when generating this dynamically:
Code:

'pos_reservas' => new soapval('pos_reservas','pos_reservas',array ('centro_coste' => '1EMH330404','material' => '10000486','almacen' => 'MAGC','cantidad' => '2'),false,''),new soapval('pos_reservas','pos_reservas',array('centro_coste' => '1EMH330404','material' => '10000485','almacen' => 'MAGC','cantidad' => '5'),false,'')


I don't know how to manage to create as much soapvals as needed to send the correct XML.

Any help would be apreciated, thanks in advance for help and excuse my enlgish and my noob questions.
View user's profileFind all posts by klippahSend private message


Joined: 28 Nov 2008
Posts: 4
Reply with quote
The WSDL looks like this:

Code:
WSDL Schema
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions name="os_ReservaMaterialCrear" targetNamespace="urn:bsa:bsanet" xmlns:p1="urn:bsa:bsanet"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <xsd:schema targetNamespace="urn:bsa:bsanet" xmlns="urn:bsa:bsanet"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="CrearReserva" type="CrearReserva" />
<xsd:element name="CrearReservaResp" type="CrearReservaResp" />
- <xsd:complexType name="CrearReserva">
- <xsd:sequence>
- <xsd:element name="sistema" type="xsd:string">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">02c083c09e7b11ddb34c001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Identificador unívoco de sistema</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="usuario" type="xsd:string">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">87e597209a9811ddc291001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Nombre del usuario</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="fecha_base" type="xsd:string" minOccurs="0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">87e808209a9811ddbee7001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Fecha base de la reserva</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="tipo_movimiento" type="xsd:string" minOccurs="0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">87e808219a9811dd9575001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Clase de movimiento (gestión stocks)</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="destinatario" type="xsd:string">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">87e808229a9811dd87d3001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Destinatario de mercancías</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="centro" type="xsd:string" minOccurs="0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">87e808239a9811dd915a001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Centro</xsd:documentation>
</xsd:annotation>
21/10/2008 Pág. 9 de 12 Versión 1.0
</xsd:element>
- <xsd:element name="pos_reservas" maxOccurs="unbounded">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">c44d75209a9811ddc270001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Posiciones de la reserva</xsd:documentation>
</xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="centro_coste" type="xsd:string">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">2925ff209a9a11ddcf05001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Centro de coste</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="material" type="xsd:string">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">2925ff219a9a11dd8c01001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Número de material</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="centro" type="xsd:string" minOccurs="0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">2925ff229a9a11ddce7c001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Centro</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="almacen" type="xsd:string">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">2925ff239a9a11dd87cc001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Almacén</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="lote" type="xsd:string" minOccurs="0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">2925ff249a9a11ddaee6001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Número de lote</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="cantidad" type="xsd:decimal">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">0a3fbaa09a9b11ddb606001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Cantidad en unidad de medida de entrada</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="numero_cuenta" type="xsd:string" minOccurs="0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">0a3fbaa19a9b11ddbb12001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Número de la cuenta de mayor</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="texto" type="xsd:string" minOccurs="0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">0a3fbaa29a9b11dd9ce2001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Texto posición</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
21/10/2008 Pág. 10 de 12 Versión 1.0
- <xsd:complexType name="CrearReservaResp">
- <xsd:sequence>
- <xsd:element name="error" type="xsd:string" minOccurs="0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">c80d5bf09a9b11ddacca001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Indicador de error</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="retorno" minOccurs="0" maxOccurs="unbounded"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">c80d5bf19a9b11dda6f0001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Parámetro de retorno</xsd:documentation>
</xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="tipo_mensaje" type="xsd:string">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">c80d5bf29a9b11ddab9a001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Tipo mensaje: S Success, E Error, W Warning, I Info A
Abort</xsd:documentation>
</xsd:annotation>
</xsd:element>
- <xsd:element name="texto_mensaje" type="xsd:string">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">c80d5bf39a9b11ddcc69001b38d25cc5</xsd:appinfo>
<xsd:documentation xml:lang="ES">Texto de mensaje</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
- <wsdl:message name="CrearReserva">
<wsdl:part name="CrearReserva" element="p1:CrearReserva" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
/>
</wsdl:message>
- <wsdl:message name="CrearReservaResp">
<wsdl:part name="CrearReservaResp" element="p1:CrearReservaResp"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
</wsdl:message>
- <wsdl:portType name="os_ReservaMaterialCrear">
- <wsdl:operation name="os_ReservaMaterialCrear">
<wsdl:input message="p1:CrearReserva" />
<wsdl:output message="p1:CrearReservaResp" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="os_ReservaMaterialCrearBinding" type="p1:os_ReservaMaterialCrear"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
- <wsdl:operation name="os_ReservaMaterialCrear">
<soap:operation soapAction="http://sap.com/xi/WebService/soap1.1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
- <wsdl:input>
<soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:output>
</wsdl:operation>
21/10/2008 Pág. 11 de 12 Versión 1.0
</wsdl:binding>
- <wsdl:service name="os_ReservaMaterialCrearService">
- <wsdl:port name="os_ReservaMaterialCrearPort" binding="p1:os_ReservaMaterialCrearBinding"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<soap:address
location="http://benelus:50100/XISOAPAdapter/MessageServlet?channel=:BSANET_DEV:bsanet_CrearRe
serva_SOAP_Client&version=3.0" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


I don't see "pos_reservas" type as an array..

Code:
<xsd:element name="pos_reservas" maxOccurs="unbounded">


Maybe that would solve my problem? Because i could use something like that (applying to my parameters ofc):

Code:

$job = array(
  "Name" => "Foobar",
  "Field1" => 42,
  "Field2" => "x",
  "Mutationen" => array (
    "Mutation" => array (
      "Name" => "Foobar",
      "JobParams" => array (
        "JobParam" => array("JobParamId" => 1, "Value" => "foo")
      )
    )
  )
);
View user's profileFind all posts by klippahSend private message


Joined: 28 Nov 2008
Posts: 4
Reply with quote
I'm also tried sending the whole XML genrated "by hand", doing that way:

Code:

require_once("../recursos/lib/nusoap.php");
$proxyhost = isset($_POST["proxyhost"]) ? $_POST["proxyhost"] : "";
$proxyport = isset($_POST["proxyport"]) ? $_POST["proxyport"] : "";
$proxyusername = isset($_POST["proxyusername"]) ? $_POST["proxyusername"] : "";
$proxypassword = isset($_POST["proxypassword"]) ? $_POST["proxypassword"] : "";
$useCURL = isset($_POST["usecurl"]) ? $_POST["usecurl"] : "0";
$client = new nusoap_client("http://benelus:50100/XISOAPAdapter/MessageServlet?channel=:BSANET_DEV:bsanet_CrearReserva_SOAP_Client&amp;version=3.0", false,
                  $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
   echo "<h2>Constructor error</h2><pre>" . $err . "</pre>";
   echo "<h2>Debug</h2><pre>" . htmlspecialchars($client->getDebug(), ENT_QUOTES) . "</pre>";
   exit();
}
$client->setCredentials("xi_bsanet","xi_bsanet");
$client->setUseCurl($useCURL);
// This is an archaic parameter list


   $XMLstring = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:bsa:bsanet">';
   $XMLstring =$XMLstring ."<soapenv:Header/>";
   $XMLstring =$XMLstring ."<soapenv:Body>";
   $XMLstring =$XMLstring ."<urn:CrearReserva>";
   $XMLstring =$XMLstring ."<usuario>JORDI</usuario>";
   $XMLstring =$XMLstring ."<sistema>BSANET</sistema>";
   $XMLstring =$XMLstring ."<destinatario>PERE</destinatario>";
   $XMLstring =$XMLstring ."<pos_reservas>";
   $XMLstring =$XMLstring ."<centro_coste>1EMH330404</centro_coste>";
   $XMLstring =$XMLstring ."<material>10000485</material>";
   $XMLstring =$XMLstring ."<almacen>MAGC</almacen>";
   $XMLstring =$XMLstring ."<cantidad>123</cantidad>";
   $XMLstring =$XMLstring ."</pos_reservas>";
   $XMLstring =$XMLstring ."<pos_reservas>";
   $XMLstring =$XMLstring ."<centro_coste>1EMH330404</centro_coste>";
   $XMLstring =$XMLstring ."<material>10000486</material>";
   $XMLstring =$XMLstring ."<almacen>MAGC</almacen>";
   $XMLstring =$XMLstring ."<cantidad>456</cantidad>";
   $XMLstring =$XMLstring ."</pos_reservas>";         
   $XMLstring =$XMLstring ."</urn:CrearReserva>";
   $XMLstring =$XMLstring ."</soapenv:Body>";
   $XMLstring =$XMLstring ."</soapenv:Envelope>";
   
   $soapaction = "os_ReservaMaterialCrear";

   $mysoapmsg = $client->serializeEnvelope($XMLstring,'',array(),"document", "literal",'');
    $result = $client->send($mysoapmsg,$soapaction);

   if ($client->fault) {
      echo "<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>"; print_r($result); echo "</pre>";
   } else {
      $err = $client->getError();
      if ($err) {
         echo "<h2>Error</h2><pre>" . $err . "</pre>";
      } else {
         echo "<h2>Result</h2><pre>"; print_r($result); echo "</pre>";
      }
   }
   echo "<h2>Request</h2><pre>" . htmlspecialchars($client->request, ENT_QUOTES) . "</pre>";
   echo "<h2>Response</h2><pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";
   echo "<h2>Debug</h2><pre>" . htmlspecialchars($client->getDebug(), ENT_QUOTES) . "</pre>";


The message is arriving to XI Server and seems well formed but it's giving me that error:

[code]

Notice: Undefined property: nusoap_client::$operation in F:\recursos\lib\nusoap.php on line 7519

Result
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: Application:EXCEPTION_DURING_EXECUTE:
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:207)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)

)

)

)

Request
POST /XISOAPAdapter/MessageServlet?channel=:BSANET_DEV:bsanet_CrearReserva_SOAP_Client&amp;version=3.0 HTTP/1.0
Host: benelus:50100
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: "os_ReservaMaterialCrear"
Authorization: Basic eGlfYnNhbmV0OnhpX2JzYW5ldA==
Content-Length: 905

<?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/"><SOAP-ENV:Body><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:bsa:bsanet"><soapenv:Header/><soapenv:Body><urn:CrearReserva><usuario>JORDI</usuario><sistema>BSANET</sistema><destinatario>PERE</destinatario><pos_reservas><centro_coste>1EMH330404</centro_coste><material>10000485</material><almacen>MAGC</almacen><cantidad>123</cantidad></pos_reservas><pos_reservas><centro_coste>1EMH330404</centro_coste><material>10000486</material><almacen>MAGC</almacen><cantidad>456</cantidad></pos_reservas></urn:CrearReserva></soapenv:Body></soapenv:Envelope></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response
HTTP/1.1 500 Internal Server Error
Connection: close
Set-Cookie: JSESSIONID=(benelus_XID_01)ID1232314650DB11656244804724496146End; Version=1; Path=/
Set-Cookie: saplb_*=(benelus_XID_01)18594450; Version=1; Path=/
Server: SAP J2EE Engine/7.00
Content-Type: text/xml; charset=utf-8
Date: Fri, 28 Nov 2008 13:13:27 GMT

<?xml version='1.0'?>
<!-- see the documentation -->
<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>
<SOAP:Body>
<SOAP:Fault>
<faultcode>SOAP:Server</faultcode>
<faultstring>Server Error</faultstring>
<detail>
<s:SystemError xmlns:s='http://sap.com/xi/WebService/xi2.0'>
<context>XIAdapter</context>
<code>ADAPTER.JAVA_EXCEPTION</code>
<text><![CDATA[
com.sap.aii.af.ra.ms.api.DeliveryException: Application:EXCEPTION_DURING_EXECUTE:
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:207)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
]]></text>
</s:SystemError>
</detail>
</SOAP:Fault>
</SOAP:Body>
</SOAP:Envelope>

Debug
2008-11-28 14:15:41.102825 nusoap_client: ctor wsdl=1 timeout=0 response_timeout=30
endpoint=string(117) "http://benelus:50100/XISOAPAdapter/MessageServlet?channel=:BSANET_DEV:bsanet_CrearReserva_SOAP_Client&amp;version=3.0"
2008-11-28 14:15:41.103175 nusoap_client: will use lazy evaluation of wsdl from http://benelus:50100/XISOAPAdapter/MessageServlet?channel=:BSANET_DEV:bsanet_CrearReserva_SOAP_Client&amp;version=3.0
2008-11-28 14:15:41.103419 nusoap_client: setCredentials username=xi_bsanet authtype=basic certRequest=
array(0) {
}
2008-11-28 14:15:41.103669 nusoap_client: setUseCURL(0)
2008-11-28 14:15:41.103926 nusoap_client: In serializeEnvelope length=575 body (max 1000 characters)=<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:bsa:bsanet"><soapenv:Header/><soapenv:Body><urn:CrearReserva><usuario>JORDI</usuario><sistema>BSANET</sistema><destinatario>PERE</destinatario><pos_reservas><centro_coste>1EMH330404</centro_coste><material>10000485</material><almacen>MAGC</almacen><cantidad>123</cantidad></pos_reservas><pos_reservas><centro_coste>1EMH330404</centro_coste><material>10000486</material><almacen>MAGC</almacen><cantidad>456</cantidad></pos_reservas></urn:CrearReserva></soapenv:Body></soapenv:Envelope> style=document use=literal encodingStyle=
2008-11-28 14:15:41.104158 nusoap_client: headers:
string(0) ""
2008-11-28 14:15:41.104493 nusoap_client: namespaces:
array(0) {
}
2008-11-28 14:15:41.105125 nusoap_client: transporting via HTTP
2008-11-28 14:15:41.109288 nusoap_client: sending message, length=905
2008-11-28 14:15:41.105733 soap_transport_http: ctor url=http://benelus:50100/XISOAPAdapter/MessageServlet?channel=:BSANET_DEV:bsanet_CrearReserva_SOAP_Client&amp;version=3.0 use_curl=0 curl_options:
array(0) {
}
2008-11-28 14:15:41.106113 soap_transport_http: parsed URL scheme = http
2008-11-28 14:15:41.106353 soap_transport_http: parsed URL host = benelus
2008-11-28 14:15:41.106652 soap_transport_http: parsed URL port = 50100
2008-11-28 14:15:41.106886 soap_transport_http: parsed URL path = /XISOAPAdapter/MessageServlet
2008-11-28 14:15:41.107117 soap_transport_http: parsed URL query = channel=:BSANET_DEV:bsanet_CrearReserva_SOAP_Client&amp;version=3.0
2008-11-28 14:15:41.107367 soap_transport_http: set header Host: benelus:50100
2008-11-28 14:15:41.107689 soap_transport_http: set header User-Agent: NuSOAP/0.7.3 (1.114)
2008-11-28 14:15:41.107946 soap_transport_http: set header Content-Type: text/xml; charset=ISO-8859-1
2008-11-28 14:15:41.108186 soap_transport_http: set header SOAPAction: "os_ReservaMaterialCrear"
2008-11-28 14:15:41.108516 soap_transport_http: setCredentials username=xi_bsanet authtype=basic digestRequest=
array(0) {
}
2008-11-28 14:15:41.108760 soap_transport_http: certRequest=
array(0) {
}
2008-11-28 14:15:41.109012 soap_transport_http: set header Authorization: Basic eGlfYnNhbmV0OnhpX2JzYW5ldA==
2008-11-28 14:15:41.109666 soap_transport_http: entered send() with data of length: 905
2008-11-28 14:15:41.109929 soap_transport_http: connect connection_timeout 0, response_timeout 30, scheme http, host benelus, port 50100
2008-11-28 14:15:41.110210 soap_transport_http: calling fsockopen with host benelus connection_timeout 0
2008-11-28 14:15:41.114084 soap_transport_http: set response timeout to 30
2008-11-28 14:15:41.114436 soap_transport_http: socket connected
2008-11-28 14:15:41.114706 soap_transport_http: set header Content-Length: 905
2008-11-28 14:15:41.114948 soap_transport_http: HTTP request: POST /XISOAPAdapter/MessageServlet?channel=:BSANET_DEV:bsanet_CrearReserva_SOAP_Client&amp;version=3.0 HTTP/1.0
2008-11-28 14:15:41.115186 soap_transport_http: HTTP header: Host: benelus:50100
2008-11-28 14:15:41.115427 soap_transport_http: HTTP header: User-Agent: NuSOAP/0.7.3 (1.114)
2008-11-28 14:15:41.115659 soap_transport_http: HTTP header: Content-Type: text/xml; charset=ISO-8859-1
2008-11-28 14:15:41.115891 soap_transport_http: HTTP header: SOAPAction: "os_ReservaMaterialCrear"
2008-11-28 14:15:41.116297 soap_transport_http: HTTP header: Authorization: Basic eGlfYnNhbmV0OnhpX2JzYW5ldA==
2008-11-28 14:15:41.116994 soap_transport_http: HTTP header: Content-Length: 905
2008-11-28 14:15:41.117634 soap_transport_http: wrote data to socket, length = 1230
2008-11-28 14:15:54.436566 soap_transport_http: read line of 36 bytes: HTTP/1.1 500 Internal Server Error
2008-11-28 14:15:54.437070 soap_transport_http: read line of 19 bytes: Connection: close
2008-11-28 14:15:54.437478 soap_transport_http: read line of 97 bytes: Set-Cookie: JSESSIONID=(benelus_XID_01)ID1232314650DB11656244804724496146End; Version=1; Path=/
2008-11-28 14:15:54.437893 soap_transport_http: read line of 65 bytes: Set-Cookie: saplb_*=(benelus_XID_01)18594450; Version=1; Path=/
2008-11-28 14:15:54.438309 soap_transport_http: read line of 30 bytes: Server: SAP J2EE Engine/7.00
2008-11-28 14:15:54.438704 soap_transport_http: read line of 39 bytes: Content-Type: text/xml; charset=utf-8
2008-11-28 14:15:54.439092 soap_transport_http: read line of 37 bytes: Date: Fri, 28 Nov 2008 13:13:27 GMT
2008-11-28 14:15:54.439490 soap_transport_http: read line of 2 bytes:
2008-11-28 14:15:54.440002 soap_transport_http: found end of headers after length 325
2008-11-28 14:15:54.440743 soap_transport_http: found cookie: JSESSIONID = (benelus_XID_01)ID1232314650DB11656244804724496146End
2008-11-28 14:15:54.441371 soap_transport_http: found cookie: saplb_* = (benelus_XID_01)18594450
2008-11-28 14:15:54.442016 soap_transport_http: want to read content to EOF
2008-11-28 14:15:54.515850 soap_transport_http: read buffer of 1258 bytes
2008-11-28 14:15:54.516177 soap_transport_http: read to EOF
2008-11-28 14:15:54.516412 soap_transport_http: read body of length 1258
2008-11-28 14:15:54.516648 soap_transport_http: received a total of 1583 bytes of data from server
2008-11-28 14:15:54.516996 soap_transport_http: closed socket
2008-11-28 14:15:54.517259 soap_transport_http: No Content-Encoding header
2008-11-28 14:15:54.517502 soap_transport_http: end of send()
2008-11-28 14:15:54.517760 nusoap_client: Setting new cookie(s)
2008-11-28 14:15:54.518012 nusoap_client: got response, length=1258 type=text/xml; charset=utf-8
2008-11-28 14:15:54.518369 nusoap_client: Entering parseResponse() for data of length 1258 headers:
array(5) {
["connection"]=>
string(5) "close"
["set-cookie"]=>
string(51) "saplb_*=(benelus_XID_01)18594450; Version=1; Path=/"
["server"]=>
string(20) "SAP J2EE Engine/7.00"
["content-type"]=>
string(23) "text/xml; charset=utf-8"
["date"]=>
string(29) "Fri, 28 Nov 2008 13:13:27 GMT"
}
2008-11-28 14:15:54.518652 nusoap_client: Got response encoding: utf-8
2008-11-28 14:15:54.518926 nusoap_client: Use encoding: UTF-8 when creating nusoap_parser
2008-11-28 14:15:54.519454 nusoap_parser: No encoding specified in XML declaration
2008-11-28 14:15:54.519874 nusoap_parser: Entering nusoap_parser(), length=1258, encoding=UTF-8
2008-11-28 14:15:54.520640 nusoap_parser: found root struct Fault, pos 2
2008-11-28 14:15:54.521967 nusoap_parser: in buildVal() for SystemError(pos 6) of type
2008-11-28 14:15:54.522387 nusoap_parser: in buildVal, there are children
2008-11-28 14:15:54.522811 nusoap_parser: in buildVal, adding Java Vector or generic compound type SystemError
2008-11-28 14:15:54.523256 nusoap_parser: in buildVal, return:
array(3) {
["context"]=>
&string(9) "XIAdapter"
["code"]=>
&string(22) "ADAPTER.JAVA_EXCEPTION"
["text"]=>
&string(720) "
com.sap.aii.af.ra.ms.api.DeliveryException: Application:EXCEPTION_DURING_EXECUTE:
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:207)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
"
}
2008-11-28 14:15:54.523771 nusoap_parser: in buildVal() for detail(pos 5) of type
2008-11-28 14:15:54.524181 nusoap_parser: in buildVal, there are children
2008-11-28 14:15:54.524601 nusoap_parser: in buildVal, adding Java Vector or generic compound type detail
2008-11-28 14:15:54.525022 nusoap_parser: in buildVal, return:
array(1) {
["SystemError"]=>
&array(3) {
["context"]=>
&string(9) "XIAdapter"
["code"]=>
&string(22) "ADAPTER.JAVA_EXCEPTION"
["text"]=>
&string(720) "
com.sap.aii.af.ra.ms.api.DeliveryException: Application:EXCEPTION_DURING_EXECUTE:
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:207)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
"
}
}
2008-11-28 14:15:54.525526 nusoap_parser: in buildVal() for Fault(pos 2) of type struct
2008-11-28 14:15:54.525944 nusoap_parser: in buildVal, there are children
2008-11-28 14:15:54.526359 nusoap_parser: in buildVal, adding Java Vector or generic compound type Fault
2008-11-28 14:15:54.526798 nusoap_parser: in buildVal, return:
array(3) {
["faultcode"]=>
&string(11) "SOAP:Server"
["faultstring"]=>
&string(12) "Server Error"
["detail"]=>
&array(1) {
["SystemError"]=>
&array(3) {
["context"]=>
&string(9) "XIAdapter"
["code"]=>
&string(22) "ADAPTER.JAVA_EXCEPTION"
["text"]=>
&string(720) "
com.sap.aii.af.ra.ms.api.DeliveryException: Application:EXCEPTION_DURING_EXECUTE:
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:207)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
"
}
}
}
2008-11-28 14:15:54.527370 nusoap_parser: parsed successfully, found root struct: 2 of name Fault

[/code]

Any ideas?
View user's profileFind all posts by klippahSend private message


Joined: 28 Nov 2008
Posts: 4
Reply with quote
Ok, it's solved Razz At the end i was able to send the xml string just with this:



Code:

   $mysoapmsg = $client->serializeEnvelope($XMLstring,'',array(),'document', 'literal');
        $result = $client->send($mysoapmsg,$soapaction);
View user's profileFind all posts by klippahSend private message
Problem consuming SAP-XI webservice
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic