Problems comsuming a SAP Enterprise Service

856 views
Skip to first unread message

Tobi

unread,
Sep 26, 2007, 6:10:20 AM9/26/07
to soap4r
Hi,

I just wanted to consume an SAP enterprise webservice using ruby, and
I even could make it for an webservice which just uses very simple
input structures. But now I've found another one I wanted to use but I
couldn't manage it. The problem is, that the input parameters do not
properly exist in the soap message. I would be happy if someone could
help me :).

I'll append the input parameter structure, my code, the sopa request
and the wsdl.


============================
Here is the input parameter description (extracted from wsdl):
============================

+ MaterialSimpleSelectionByIDAndDescription
+ SelectionByMaterialInternalID
InclusionExclusionCode
IntervalBoundaryTypeCode
LowerBoundaryMaterialInternalID
UpperBoundaryMaterialInternalID
+ SelectionByMaterialDescription
InclusionExclusionCode
IntervalBoundaryTypeCode
LowerBoundaryDescription
UpperBoundaryDescription
MaximumNumberValue

So what I basically tried is to create a hash in a hash to have to
match the hierarchie of the paramaters. But that doesn't work.

============================
Heres my code:
============================

require 'rubygems'
gem 'soap4r'
require 'soap/wsdldriver'

$DEBUG = true

service = SOAP::WSDLDriverFactory.new('http://iwdf2303.wdf.sap.corp:
55080/sap/bc/srt/xip/sap/ecc_materialbyiddescr001qr?sap-
client=800&wsdl=1.1&mode=sap_wsdl').create_rpc_driver

service.generate_explicit_type = true
service.wiredump_dev = STDOUT if $DEBUG

params = {
:MaterialSimpleSelectionByIDAndDescription => {
:SelectionByMaterialInternalID => {
:InclusionExclusionCode => 'I',
:IntervalBoundaryTypeCode => 3,
:LowerBoundaryMaterialInternalID => '*-001',
:UpperBoundaryMaterialInternalID => '*-999'
},
:SelectionByMaterialDescription => {
:InclusionExclusionCode => '',
:IntervalBoundaryTypeCode => '',
:LowerBoundaryMaterialInternalID => '',
:UpperBoundaryMaterialInternalID => ''
},
:MaximumNumberValue => 5
}
}

result =
service.MaterialSimpleByIDAndDescriptionQueryResponse_In(params)

============================
The SOAP request: (The MaximumNumberValue is right, but nothing else.)
============================

<?xml version="1.0" encoding="utf-8" ?>

<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<env:Body>

<n1:MaterialSimpleByIDAndDescriptionQuery_sync xmlns:n1="http://
sap.com/xi/SAPGlobal20/Global">

<MaterialSimpleSelectionByIDAndDescription>

<SelectionByMaterialInternalID></
SelectionByMaterialInternalID>

<SelectionByMaterialInternalID></
SelectionByMaterialInternalID>

<SelectionByMaterialInternalID></
SelectionByMaterialInternalID>

<SelectionByMaterialInternalID></
SelectionByMaterialInternalID>

<SelectionByMaterialDescription></
SelectionByMaterialDescription>

<SelectionByMaterialDescription></
SelectionByMaterialDescription>

<SelectionByMaterialDescription></
SelectionByMaterialDescription>

<SelectionByMaterialDescription></
SelectionByMaterialDescription>

<MaximumNumberValue>5</MaximumNumberValue>

</MaterialSimpleSelectionByIDAndDescription>

</n1:MaterialSimpleByIDAndDescriptionQuery_sync>

</env:Body>

</env:Envelope>

============================
Here's the wsdl:
============================

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions targetNamespace="http://sap.com/xi/EA-APPL/SE/
Global" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:n1="http://
www.sap.com/webas/630/soap/features/authentication/" xmlns:sap="http://
www.sap.com/webas/630/wsdl/features" xmlns:soap="http://
schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://sap.com/xi/EA-APPL/
SE/Global" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:xi0="http://sap.com/
xi/SAPGlobal20/Global" xmlns:xi1="http://sap.com/xi/EA-APPL/SE/Global"
targetNamespace="http://sap.com/xi/SAPGlobal20/Global" xmlns="http://
sap.com/xi/SAPGlobal20/Global">
<xsd:import namespace="http://sap.com/xi/EA-APPL/SE/Global"/>
<xsd:element name="MaterialSimpleByIDAndDescriptionQuery_sync"
type="xi1:MaterialSimpleByIDAndDescriptionQueryMessage_sync"/>
<xsd:element name="MaterialSimpleByIDAndDescriptionResponse_sync"
type="xi1:MaterialSimpleByIDAndDescriptionResponseMessage_sync"/>
<xsd:element name="StandardMessageFault">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="standard" type="xi1:ExchangeFaultData"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:xi0="http://sap.com/
xi/SAPGlobal20/Global" xmlns:xi1="http://sap.com/xi/EA-APPL/SE/Global"
targetNamespace="http://sap.com/xi/EA-APPL/SE/Global" xmlns="http://
sap.com/xi/EA-APPL/SE/Global">
<xsd:complexType name="ExchangeFaultData">
<xsd:sequence>
<xsd:element name="faultText" type="xsd:string"/>
<xsd:element name="faultUrl" minOccurs="0" type="xsd:string"/>
<xsd:element name="faultDetail" minOccurs="0"
maxOccurs="unbounded" type="ExchangeLogData"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ExchangeLogData">
<xsd:sequence>
<xsd:element name="severity" minOccurs="0" type="xsd:string"/>
<xsd:element name="text" type="xsd:string"/>
<xsd:element name="url" minOccurs="0" type="xsd:string"/>
<xsd:element name="id" minOccurs="0" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="InclusionExclusionCode">
<xsd:restriction base="xsd:token">
<xsd:length value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="IntervalBoundaryTypeCode">
<xsd:restriction base="xsd:token">
<xsd:length value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="LanguageCode">
<xsd:restriction base="xsd:language">
<xsd:maxLength value="9"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Log">
<xsd:sequence>
<xsd:element name="BusinessDocumentProcessingResultCode"
minOccurs="0" type="ProcessingResultCode"/>
<xsd:element name="MaximumLogItemSeverityCode" minOccurs="0"
type="LogItemSeverityCode"/>
<xsd:element name="Item" minOccurs="0" maxOccurs="unbounded"
type="LogItem"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="LogItem">
<xsd:sequence>
<xsd:element name="TypeID" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:maxLength value="40"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CategoryCode" type="LogItemCategoryCode"/>
<xsd:element name="SeverityCode" minOccurs="0"
type="LogItemSeverityCode"/>
<xsd:element name="Note">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="200"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="WebURI" minOccurs="0" type="WebURI"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="LogItemCategoryCode">
<xsd:simpleContent>
<xsd:extension base="LogItemCategoryCodeContent">
<xsd:attribute name="listAgencyID">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:maxLength value="60"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="listVersionID">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:maxLength value="15"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="listAgencySchemeID">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:maxLength value="60"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="listAgencySchemeAgencyID">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:maxLength value="3"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="LogItemCategoryCodeContent">
<xsd:restriction base="xsd:token">
<xsd:maxLength value="15"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="LogItemSeverityCode">
<xsd:restriction base="xsd:token">
<xsd:length value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType
name="MaterialSimpleByIDAndDescriptionQueryMessage_sync">
<xsd:sequence>
<xsd:element name="MaterialSimpleSelectionByIDAndDescription">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SelectionByMaterialInternalID"
minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="InclusionExclusionCode" minOccurs="0"
type="InclusionExclusionCode"/>
<xsd:element name="IntervalBoundaryTypeCode"
type="IntervalBoundaryTypeCode"/>
<xsd:element name="LowerBoundaryMaterialInternalID"
minOccurs="0" type="ProductInternalID"/>
<xsd:element name="UpperBoundaryMaterialInternalID"
minOccurs="0" type="ProductInternalID"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="SelectionByMaterialDescription"
minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="InclusionExclusionCode" minOccurs="0"
type="InclusionExclusionCode"/>
<xsd:element name="IntervalBoundaryTypeCode"
type="IntervalBoundaryTypeCode"/>
<xsd:element name="LowerBoundaryMaterialDescription"
minOccurs="0" type="SHORT_Description"/>
<xsd:element name="UpperBoundaryMaterialDescription"
minOccurs="0" type="SHORT_Description"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="MaximumNumberValue" minOccurs="0"
type="NumberValue"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType
name="MaterialSimpleByIDAndDescriptionResponseMessage_sync">
<xsd:sequence>
<xsd:element name="Material" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="InternalID" type="ProductInternalID"/>
<xsd:element name="Description">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Description" type="SHORT_Description"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Log" minOccurs="0" type="Log"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="NumberValue">
<xsd:restriction base="xsd:nonNegativeInteger">
<xsd:totalDigits value="9"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ProcessingResultCode">
<xsd:restriction base="xsd:token">
<xsd:maxLength value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="ProductInternalID">
<xsd:simpleContent>
<xsd:extension base="ProductInternalIDContent">
<xsd:attribute name="schemeID">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:maxLength value="60"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="schemeAgencyID">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:maxLength value="60"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="ProductInternalIDContent">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="60"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="SHORT_Description">
<xsd:simpleContent>
<xsd:extension base="SHORT_DescriptionContent">
<xsd:attribute name="languageCode" type="LanguageCode"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="SHORT_DescriptionContent">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="40"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="WebURI">
<xsd:restriction base="xsd:anyURI"/>
</xsd:simpleType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="MaterialSimpleByIDAndDescriptionQuery_sync">
<wsdl:part name="parameters"
element="n0:MaterialSimpleByIDAndDescriptionQuery_sync"/>
</wsdl:message>
<wsdl:message name="MaterialSimpleByIDAndDescriptionResponse_sync">
<wsdl:part name="parameters"
element="n0:MaterialSimpleByIDAndDescriptionResponse_sync"/>
</wsdl:message>
<wsdl:message name="exception00">
<wsdl:part name="exception00" element="n0:StandardMessageFault"/>
</wsdl:message>
<sap:Feature name="design_0 " uri="http://www.sap.com/webas/630/soap/
features/authentication/">
<sap:Property qname="n1:AuthenticationLevel">
<sap:Option value="n1:Basic"/>
</sap:Property>
</sap:Feature>
<wsdl:portType
name="MaterialSimpleByIDAndDescriptionQueryResponse_In">
<sap:useFeature feature="tns:design_0 "/>
<wsdl:operation
name="MaterialSimpleByIDAndDescriptionQueryResponse_In">
<wsdl:input
message="tns:MaterialSimpleByIDAndDescriptionQuery_sync"/>
<wsdl:output
message="tns:MaterialSimpleByIDAndDescriptionResponse_sync"/>
<wsdl:fault name="exception00" message="tns:exception00"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding
name="MaterialSimpleByIDAndDescriptionQueryResponse_InSoapBinding"
type="tns:MaterialSimpleByIDAndDescriptionQueryResponse_In">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/
soap/http"/>
<wsdl:operation
name="MaterialSimpleByIDAndDescriptionQueryResponse_In">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="exception00">
<soap:fault name="exception00" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service
name="MaterialSimpleByIDAndDescriptionQueryResponse_InService">
<wsdl:port
name="MaterialSimpleByIDAndDescriptionQueryResponse_InSoapBinding"
binding="tns:MaterialSimpleByIDAndDescriptionQueryResponse_InSoapBinding">
<soap:address location="http://iwdf2303.wdf.sap.corp:55080/sap/bc/
srt/xip/sap/ECC_MATERIALBYIDDESCR001QR?sap-client=800"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Andre Kloth

unread,
Sep 26, 2007, 7:47:43 AM9/26/07
to soa...@googlegroups.com
Hi Tobi.

On Wednesday 26 September 2007, Tobi wrote:

> I just wanted to consume an SAP enterprise webservice using ruby, and
> I even could make it for an webservice which just uses very simple
> input structures. But now I've found another one I wanted to use but I
> couldn't manage it. The problem is, that the input parameters do not
> properly exist in the soap message. I would be happy if someone could
> help me :).

I had a similar problem as well. This was due to the fact that wsdl2ruby
could not cope with private/local (anonymous) complexType definitions.
Therefore I had to rewrite the WSDL -- I do not know if this is still
necessary.

Attached is a working code example with a ruby client, generated ruby stubs
and the rewritten WSDL.

Just change USER and PASS in client-test.rb for authentication and
run "ruby -d client-test.rb". This will give you _all_ currently available
materials.


HTH,
Andre'

SAP-WS.tar.gz
signature.asc

Tobi

unread,
Sep 26, 2007, 8:35:25 AM9/26/07
to soap4r
Hi,

thanks Andre, I have to compare the wsdls to see how you rewrote it,
but at the moment I've got several problems:
1. I've no user for the webservice you called (but obviously it's the
same one)
2. I took the webservice URL from the webservice I have access to (SAP
SDN), but I get an error. SOAP looks like (and it looks right for my
eyes):

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:MaterialSimpleByIDAndDescriptionQuery_sync xmlns:n1="http://
sap.com/xi/SAPGlobal20/Global">

<MaterialSimpleSelectionByIDAndDescription xmlns:n2="http://
sap.com/xi/SCMBasis/Foundation/Global"
xsi:type="n2:MaterialSimpleSelectionByIDAndDescription">
<SelectionByMaterialInternalID
xsi:type="n2:SelectionByMaterialInternalID">
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryMaterialInternalID
xsi:type="n2:ProductInternalID">*</LowerBoundaryMaterialInternalID>
</SelectionByMaterialInternalID>
<SelectionByMaterialDescription
xsi:type="n2:SelectionByMaterialDescription">
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryMaterialDescription
xsi:type="n2:SHORT_Description">*</LowerBoundaryMaterialDescription>
</SelectionByMaterialDescription>


</MaterialSimpleSelectionByIDAndDescription>
</n1:MaterialSimpleByIDAndDescriptionQuery_sync>
</env:Body>
</env:Envelope>

And the answer is:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/
envelope/">
<soap-env:Body>
<soap-env:Fault>
<faultcode>soap-env:Server</faultcode>
<faultstring xml:lang="en">Information about the method
parameters is missing for the interface (ABAP interface, request
messageMaterialSimpleByIDAndDescriptionQuery_sync, request message,
namespace http://sap.com/xi/SAPGlobal20/Global)
</faultstring></soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>
! CONNECTION CLOSED

Dump is:

Exception `SOAP::FaultError' at c:/dev/ruby/lib/ruby/gems/1.8/gems/
soap4r-1.5.7/lib/soap/rpc/proxy.rb:188 - Information about the method
parameters is missing for the interface (ABAP interface, request
message MaterialSimpleByIDAndDescriptionQuery_sync, request message,
namespace http://sap.com/xi/SAPGlobal20/Global)
Exception `SOAP::FaultError' at c:/dev/ruby/lib/ruby/gems/1.8/gems/
soap4r-1.5.7/lib/soap/mapping/mapping.rb:118 - Information about the
method parameters is missing for the interface (ABAP interface,
request message MaterialSimpleByIDAndDescriptionQuery_sync, request
message, namespace http://sap.com/xi/SAPGlobal20/Global)
: Information about the method parameters is missing for the interface
(ABAP interface, request message
MaterialSimpleByIDAndDescriptionQuery_sync, request message, namespace
http://sap.com/xi/SAPGlobal20/Global) (SOAP::FaultError)

Did you ever get this error? Do you have any idea? I'm getting
crazy... :/

Best regards,
Tobi

> SAP-WS.tar.gz
> 5KHerunterladen
>
> signature.asc
> 1KHerunterladen

NAKAMURA, Hiroshi

unread,
Sep 26, 2007, 8:41:50 AM9/26/07
to soa...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Tobi wrote:
> I just wanted to consume an SAP enterprise webservice using ruby, and
> I even could make it for an webservice which just uses very simple
> input structures. But now I've found another one I wanted to use but I
> couldn't manage it. The problem is, that the input parameters do not
> properly exist in the soap message. I would be happy if someone could
> help me :).
>
> I'll append the input parameter structure, my code, the sopa request
> and the wsdl.

WSDLDriverFactory + Hash style is not suitable for this kind of complex
Web services. You eventually are able to construct a request with a
Hash but it should needs a lot of time. Also it should be an
uninteresting DOM like programming. Please use wsdl2ruby.rb instead.

Andre, thanks to your input. soap4r now handles anonymous complexType
so the following should work;


% wsdl2ruby.rb --wsdl sapent.wsdl --type client --force


Then, check MaterialSimpleByIAblablah_InServiceClient.rb how to
construct the request. Following it a sample.


% cat client.rb
#!/usr/bin/env ruby
require 'defaultDriver.rb'

endpoint_url = ARGV.shift
obj = MaterialSimpleByIDAndDescriptionQueryResponse_In.new(endpoint_url)

# run ruby with -d to see SOAP wiredumps.
obj.wiredump_dev = STDERR if $DEBUG

req = MaterialSimpleByIDAndDescriptionQueryMessage_sync.new

req.materialSimpleSelectionByIDAndDescription = id_and_desc =
MaterialSimpleByIDAndDescriptionQueryMessage_sync::MaterialSimpleSelectionByIDAndDescription.new

id_and_desc.selectionByMaterialInternalID << id =
MaterialSimpleByIDAndDescriptionQueryMessage_sync::MaterialSimpleSelectionByIDAndDescription::SelectionByMaterialInternalID.new

id_and_desc.selectionByMaterialDescription << desc =
MaterialSimpleByIDAndDescriptionQueryMessage_sync::MaterialSimpleSelectionByIDAndDescription::SelectionByMaterialDescription.new

id.inclusionExclusionCode = 'I'
id.intervalBoundaryTypeCode = 3
id.lowerBoundaryMaterialInternalID = id1 =
ProductInternalID.new('*-001')
id.upperBoundaryMaterialInternalID = id2 =
ProductInternalID.new('*-999')
id1.xmlattr_schemeID = 'schemeID1'
id2.xmlattr_schemeID = 'schemeID2'

desc.inclusionExclusionCode = ''
desc.intervalBoundaryTypeCode = ''
desc.lowerBoundaryMaterialDescription = ''
desc.upperBoundaryMaterialDescription = ''

id_and_desc.maximumNumberValue = 5

obj.test_loopback_response << '' # for test: causes EmptyResponseError
puts obj.materialSimpleByIDAndDescriptionQueryResponse_In(req)


This client should generate a request like this.


<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:MaterialSimpleByIDAndDescriptionQuery_sync
xmlns:n1="http://sap.com/xi/SAPGlobal20/Global">
<MaterialSimpleSelectionByIDAndDescription>
<SelectionByMaterialInternalID>

<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
<LowerBoundaryMaterialInternalID
schemeID="schemeID1">*-001</LowerBoundaryMaterialInternalID>
<UpperBoundaryMaterialInternalID
schemeID="schemeID2">*-999</UpperBoundaryMaterialInternalID>
</SelectionByMaterialInternalID>
<SelectionByMaterialDescription>
<InclusionExclusionCode></InclusionExclusionCode>
<IntervalBoundaryTypeCode></IntervalBoundaryTypeCode>

<LowerBoundaryMaterialDescription></LowerBoundaryMaterialDescription>

<UpperBoundaryMaterialDescription></UpperBoundaryMaterialDescription>
</SelectionByMaterialDescription>


<MaximumNumberValue>5</MaximumNumberValue>
</MaterialSimpleSelectionByIDAndDescription>
</n1:MaterialSimpleByIDAndDescriptionQuery_sync>
</env:Body>
</env:Envelope>


Tobi, would you please try the client against the actual server?

Regards,
// NaHi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRvpTjR9L2jg5EEGlAQJKXwgAuSt9o4Qy/Yl4nkVQWea1cNKRrpVc0P09
Xm3GvwsMnPJ0MohahuPT9rMWnJRyUsLznt1z5E4MRRQfzeuv0vE7APldGxZriQVB
+IkEQdPLvl2wX5PeJKPq3eXagWJB8LE/0iNcch7yLltIlsqtE9h3aWXsIPEQhFPi
VhGsatRqNQ66pcyKzoABjfixczfhp4ZfMvaHBZbiUyk7PGo7ocsMusSFQgAG0HPG
AO09KtpZ9Aa2ZBpRZPg1fVgCYJW0oHHlO30xCgMt1gjiarDxIIDGAwRWMY7AMj1F
u1gb01hoN8pjGCTsm6K67ja7/4glVijDjNp2BRwkbH9rP1d9aMLn4A==
=jNOH
-----END PGP SIGNATURE-----

Tobi

unread,
Sep 26, 2007, 9:21:34 AM9/26/07
to soap4r
Hi NaHi,

Thanks for your help so far.

I tried generation before, but it seems to me that the complex types
are not created. When using your sample driver I get this error:

C:/dev/sources/Ruby/WSGenerate/Generate4/test-driver.rb:13:
uninitialized constant MaterialSimpleByIDAndDescription
QueryMessage_sync::MaterialSimpleSelectionByIDAndDescription
(NameError)

The code which produces the error is:

req.materialSimpleSelectionByIDAndDescription = id_and_desc =
MaterialSimpleByIDAndDescriptionQueryMessage_sync::MaterialSimpleSelectionByIDAndDescription.new

In default.rb there is no MaterialSimpleSelectionByIDAndDescription
class.

------------------default.rb-------------------------------------

require 'xsd/qname'

# {http://sap.com/xi/EA-APPL/SE/Global}ExchangeFaultData
class ExchangeFaultData
attr_accessor :faultText
attr_accessor :faultUrl
attr_accessor :faultDetail

def initialize(faultText = nil, faultUrl = nil, faultDetail = [])
@faultText = faultText
@faultUrl = faultUrl
@faultDetail = faultDetail
end
end

# {http://sap.com/xi/EA-APPL/SE/Global}ExchangeLogData
class ExchangeLogData
attr_accessor :severity
attr_accessor :text
attr_accessor :url
attr_accessor :id

def initialize(severity = nil, text = nil, url = nil, id = nil)
@severity = severity
@text = text
@url = url
@id = id
end
end

# {http://sap.com/xi/EA-APPL/SE/Global}Log
class Log
attr_accessor :businessDocumentProcessingResultCode
attr_accessor :maximumLogItemSeverityCode
attr_accessor :item

def initialize(businessDocumentProcessingResultCode = nil,
maximumLogItemSeverityCode = nil, item = [])
@businessDocumentProcessingResultCode =
businessDocumentProcessingResultCode
@maximumLogItemSeverityCode = maximumLogItemSeverityCode
@item = item
end
end

# {http://sap.com/xi/EA-APPL/SE/Global}LogItem
class LogItem
attr_accessor :typeID
attr_accessor :categoryCode
attr_accessor :severityCode
attr_accessor :note
attr_accessor :webURI

def initialize(typeID = nil, categoryCode = nil, severityCode = nil,
note = nil, webURI = nil)
@typeID = typeID
@categoryCode = categoryCode
@severityCode = severityCode
@note = note
@webURI = webURI
end
end

# {http://sap.com/xi/EA-APPL/SE/Global}LogItemCategoryCode
class LogItemCategoryCode < ::String
def xmlattr_listAgencyID
(@__xmlattr ||= {})[XSD::QName.new(nil, "listAgencyID")]
end

def xmlattr_listAgencyID=(value)
(@__xmlattr ||= {})[XSD::QName.new(nil, "listAgencyID")] = value
end

def xmlattr_listVersionID
(@__xmlattr ||= {})[XSD::QName.new(nil, "listVersionID")]
end

def xmlattr_listVersionID=(value)
(@__xmlattr ||= {})[XSD::QName.new(nil, "listVersionID")] = value
end

def xmlattr_listAgencySchemeID
(@__xmlattr ||= {})[XSD::QName.new(nil, "listAgencySchemeID")]
end

def xmlattr_listAgencySchemeID=(value)
(@__xmlattr ||= {})[XSD::QName.new(nil, "listAgencySchemeID")] =
value
end

def xmlattr_listAgencySchemeAgencyID
(@__xmlattr ||= {})[XSD::QName.new(nil,
"listAgencySchemeAgencyID")]
end

def xmlattr_listAgencySchemeAgencyID=(value)
(@__xmlattr ||= {})[XSD::QName.new(nil,
"listAgencySchemeAgencyID")] = value
end

def initialize(*arg)
super
@__xmlattr = {}
end
end

# {http://sap.com/xi/EA-APPL/SE/
Global}MaterialSimpleByIDAndDescriptionQueryMessage_sync
class MaterialSimpleByIDAndDescriptionQueryMessage_sync
attr_accessor :materialSimpleSelectionByIDAndDescription

def initialize(materialSimpleSelectionByIDAndDescription = nil)
@materialSimpleSelectionByIDAndDescription =
materialSimpleSelectionByIDAndDescription
end
end

# {http://sap.com/xi/EA-APPL/SE/
Global}MaterialSimpleByIDAndDescriptionResponseMessage_sync
class MaterialSimpleByIDAndDescriptionResponseMessage_sync
attr_accessor :material
attr_accessor :log

def initialize(material = [], log = nil)
@material = material
@log = log
end
end

# {http://sap.com/xi/EA-APPL/SE/Global}ProductInternalID
class ProductInternalID < ::String
def xmlattr_schemeID
(@__xmlattr ||= {})[XSD::QName.new(nil, "schemeID")]
end

def xmlattr_schemeID=(value)
(@__xmlattr ||= {})[XSD::QName.new(nil, "schemeID")] = value
end

def xmlattr_schemeAgencyID
(@__xmlattr ||= {})[XSD::QName.new(nil, "schemeAgencyID")]
end

def xmlattr_schemeAgencyID=(value)
(@__xmlattr ||= {})[XSD::QName.new(nil, "schemeAgencyID")] = value
end

def initialize(*arg)
super
@__xmlattr = {}
end
end

# {http://sap.com/xi/EA-APPL/SE/Global}SHORT_Description
class SHORT_Description < ::String
def xmlattr_languageCode
(@__xmlattr ||= {})[XSD::QName.new(nil, "languageCode")]
end

def xmlattr_languageCode=(value)
(@__xmlattr ||= {})[XSD::QName.new(nil, "languageCode")] = value
end

def initialize(*arg)
super
@__xmlattr = {}
end
end

# {http://sap.com/xi/SAPGlobal20/Global}StandardMessageFault
class StandardMessageFault < ::StandardError
attr_accessor :standard

def initialize(standard = nil)
@standard = standard
end
end


------------------end----------------------------------------------

Thanks in advance.
Best Regards
Tobi

NAKAMURA, Hiroshi

unread,
Sep 26, 2007, 9:26:11 AM9/26/07
to soa...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Tobi wrote:
> I tried generation before, but it seems to me that the complex types
> are not created. When using your sample driver I get this error:

classdef generation for anonymous complexType is from soap4r-1.5.8.
Would you please update soap4r? I should have written.

Regards,
// NaHi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRvpd8h9L2jg5EEGlAQLvLwgApbGCOHKt8QhnFE8FYSv+kxYksmQBfHhO
N2TlVcPABd9XPU6WKbwT/M989lIpSuVSfsPX+ummN2pCb58WyBQu6aKIVp+f4//8
Db2iXV5mJoKLV3vFy2jnARyu2uZTQb0KOH6P8bRVyhj2kk3a0WIttG4wgmegXuzB
dGcN6GHLO/E3rPCtY/04oCq+uK5EdR+iyVpf0PZlib/ntmaIqlGRSGCpY2vtFi4d
tOK5crpo9pDeNMw61Ui5MfikGhm8swGbsN/IpUxnr/H0SYkXGXbgXYdGQXACUYj/
Vf0Luy18ldEvKINF8xv0ODBsFSmqEXTZhQsU09s0Lfisa6Ki6c8NoA==
=YMW4
-----END PGP SIGNATURE-----

Andre Kloth

unread,
Sep 26, 2007, 9:43:02 AM9/26/07
to soa...@googlegroups.com
On Wednesday 26 September 2007, Tobi wrote:

> I have to compare the wsdls to see how you rewrote it, but at the moment
> I've got several problems:

Like Nahi said, you probably do not need to rewrite the WSDL anymore.

> 1. I've no user for the webservice you called (but obviously it's the
> same one)

Well, I got an account for testing. However, you are right -- there is some
other problem.

> 2. I took the webservice URL from the webservice I have access to (SAP
> SDN), but I get an error. SOAP looks like (and it looks right for my
> eyes):

> <?xml version="1.0" encoding="utf-8" ?>
> <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <env:Body>
> <n1:MaterialSimpleByIDAndDescriptionQuery_sync xmlns:n1="http://
> sap.com/xi/SAPGlobal20/Global">
> <MaterialSimpleSelectionByIDAndDescription xmlns:n2="http://
> sap.com/xi/SCMBasis/Foundation/Global"
> xsi:type="n2:MaterialSimpleSelectionByIDAndDescription">

I am not sure if your mail client just changed the indention at an
unsuitable position or if there is a white space after 'xmlns:n1="http://'

Apart from that your SOAP requests look identical. Could you post the HTTP
headers of the request/response?

Nevertheless, the SAP web services are quite new. Hence, you may experience
more bugs in there than in SOAP4R ;)

> And the answer is:

> <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/
> envelope/">
> <soap-env:Body>
> <soap-env:Fault>
> <faultcode>soap-env:Server</faultcode>
> <faultstring xml:lang="en">Information about the method
> parameters is missing for the interface (ABAP interface, request
> messageMaterialSimpleByIDAndDescriptionQuery_sync, request message,
> namespace http://sap.com/xi/SAPGlobal20/Global)
> </faultstring></soap-env:Fault>
> </soap-env:Body>
> </soap-env:Envelope>
> ! CONNECTION CLOSED

> : Information about the method parameters is missing for the interface

Sorry, I cannot say what's the problem here. Maybe some encoding issue?

> Did you ever get this error?

No, not at all. Just curious.


Best regards,
Andre'

signature.asc

Andre Kloth

unread,
Sep 26, 2007, 9:56:43 AM9/26/07
to soa...@googlegroups.com
On Wednesday 26 September 2007, Andre Kloth wrote:

> Apart from that your SOAP requests look identical.

Typo -- should have been "our".

signature.asc

Tobi

unread,
Sep 26, 2007, 10:08:06 AM9/26/07
to soap4r
Oh a new release .... :)
ok updated, everything seems to work fine, classes are properly
generated, soap request look fine:

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:MaterialSimpleByIDAndDescriptionQuery_sync xmlns:n1="http://
sap.com/xi/SAPGlobal20/Global">
<MaterialSimpleSelectionByIDAndDescription>
<SelectionByMaterialInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
<LowerBoundaryMaterialInternalID

schemeID="schemeID1">MDE-001</LowerBoundaryMaterialInternalID>
<UpperBoundaryMaterialInternalID
schemeID="schemeID2">MDE-999</UpperBoundaryMaterialInternalID>


</SelectionByMaterialInternalID>
<SelectionByMaterialDescription>
<InclusionExclusionCode></InclusionExclusionCode>
<IntervalBoundaryTypeCode></IntervalBoundaryTypeCode>
<LowerBoundaryMaterialDescription></
LowerBoundaryMaterialDescription>
<UpperBoundaryMaterialDescription></
UpperBoundaryMaterialDescription>
</SelectionByMaterialDescription>
<MaximumNumberValue>5</MaximumNumberValue>
</MaterialSimpleSelectionByIDAndDescription>
</n1:MaterialSimpleByIDAndDescriptionQuery_sync>
</env:Body>
</env:Envelope>

... but ... I'm afraid I'm still having a problem ... :/. But that
doesn't seem to be a soap4r problem (because I think the soap message
is correct). Am I wrong?

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/
envelope/">
<soap-env:Body>
<soap-env:Fault>

<faultcode>soap-env:Client</faultcode>
<faultstring xml:lang="en">Application has thrown an exception</
faultstring>
<detail>
<nr1:StandardMessageFault xmlns:nr1="http://sap.com/xi/
SAPGlobal20/Global">
<standard>
<faultText>An exception with the type
CX_SY_DYNAMIC_OSQL_SYNTAX occurred, but was neither handled locally,
nor declared in a RAISING clause</faultText>
</standard>
</nr1:StandardMessageFault>
</detail>


</soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>! CONNEC
TION CLOSED

Exception `SOAP::FaultError' at c:/dev/ruby/lib/ruby/gems/1.8/gems/
soap4r-1.5.8/lib/soap/rpc/proxy.rb:189 - Applica
tion has thrown an exception


Exception `SOAP::FaultError' at c:/dev/ruby/lib/ruby/gems/1.8/gems/

soap4r-1.5.8/lib/soap/mapping/mapping.rb:118 - A
pplication has thrown an exception
#<SOAP::Mapping::Object:0x336c394>: Application has thrown an
exception (SOAP::FaultError)

Best regards

Tobi

unread,
Sep 26, 2007, 10:19:09 AM9/26/07
to soap4r
> Nevertheless, the SAP web services are quite new. Hence, you may experience
> more bugs in there than in SOAP4R ;)

Yes, probably you are right ;).

> > namespacehttp://sap.com/xi/SAPGlobal20/Global)


> > </faultstring></soap-env:Fault>
> > </soap-env:Body>
> > </soap-env:Envelope>
> > ! CONNECTION CLOSED
> > : Information about the method parameters is missing for the interface
>
> Sorry, I cannot say what's the problem here. Maybe some encoding issue?
>
> > Did you ever get this error?
>
> No, not at all. Just curious.
>
> Best regards,
> Andre'
>

> signature.asc
> 1KHerunterladen

Tobi

unread,
Sep 26, 2007, 10:26:24 AM9/26/07
to soap4r
So I'll post the whole wire dump:

C:\dev\sources\Ruby\WSGenerate\gen7>ruby -d test-driver.rb
Exception `LoadError' at c:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27 - no such file to load --
uconv
Exception `LoadError' at c:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:34 - no such file to load --
uconv
Exception `LoadError' at c:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:34 - no such file to load --
uconv
Set XSD::XMLParser::XMLParser as XML processor.
Exception `LoadError' at c:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27 - no such file to load --
net/ntlm
Exception `LoadError' at c:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:34 - no such file to load --
net/ntlm
Exception `LoadError' at c:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27 - no such file to load --
win32/sspi
Exception `LoadError' at c:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:34 - no such file to load --
win32/sspi
find property at c:/dev/ruby/lib/ruby/1.8/soap/property
Wire dump:

= Request

! CONNECT TO proxy:8080
! CONNECTION ESTABLISHED
POST http://erp.esworkplace.sap.com:80/sap/bc/srt/xip/sap/ECC_MATERIALBYIDDESCR001QR?sap-client=800
HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=utf-8
User-Agent: SOAP4R/1.5.8 (/187, ruby 1.8.6 (2007-03-13) [i386-
mswin32])
Date: Wed, 26 Sep 2007 14:23:38 GMT
Content-Length: 1349
Host: erp.esworkplace.sap.com

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:MaterialSimpleByIDAndDescriptionQuery_sync xmlns:n1="http://
sap.com/xi/SAPGlobal20/Global">
<MaterialSimpleSelectionByIDAndDescription>

<SelectionByMaterialInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
<LowerBoundaryMaterialInternalID
schemeID="schemeID1">MDE-001</LowerBoundaryMaterialInternalID>
<UpperBoundaryMaterialInternalID
schemeID="schemeID2">MDE-999</UpperBoundaryMaterialInternalID>
</SelectionByMaterialInternalID>
<SelectionByMaterialDescription>
<InclusionExclusionCode></InclusionExclusionCode>
<IntervalBoundaryTypeCode></IntervalBoundaryTypeCode>
<LowerBoundaryMaterialDescription></
LowerBoundaryMaterialDescription>
<UpperBoundaryMaterialDescription></
UpperBoundaryMaterialDescription>
</SelectionByMaterialDescription>
<MaximumNumberValue>5</MaximumNumberValue>

</MaterialSimpleSelectionByIDAndDescription>
</n1:MaterialSimpleByIDAndDescriptionQuery_sync>
</env:Body>
</env:Envelope>

= Response

HTTP/1.1 401 Unauthorized
Date: Wed, 26 Sep 2007 14:27:56 GMT
Server: SAP Web Application Server (1.0;700)
content-type: text/html; charset=utf-8
content-length: 1997
sap-system: HU2
www-authenticate: Basic realm="SAP Web Application Server [HU2]"
sap-client: 800
set-cookie: sap-usercontext=sap-client=800; path=/
Age: 0
Via: HTTP/1.1 SAPwdf (Traffic-Server/5.2.5-59702 [c s f ])

<html><head><title>Logon Error Message</title><META http-
equiv="Content-Type" content="text/html;charset=UTF-8"><st
yle type="text/css">body { font-family:tahoma,helvetica,sans-
serif;color:#333333;background-color:#FFFFFF; }td { fo
nt-family:tahoma,helvetica,sans-serif;font-size:70%;color:#333333; }h1
{ font-family:tahoma,helvetica,sans-serif;fo
nt-size:160%;font-weight:bold;margin-top:15px;margin-bottom:
3px;color:#003366; }h2 { font-family:verdana,helvetica,
sans-serif;font-size:120%;font-style:italic;font-weight:bold;margin-
top:6px;margin-bottom:6px;color:#999900; }p { f
ont-family:tahoma,helvetica,sans-serif;color:#333333;margin-top:
4px;margin-bottom:4px; }ul { font-family:tahoma,hel
vetica,sans-serif;color:#333333;list-style-type:square;margin-top:
8px;margin-bottom:8px; }li { font-family:tahoma,h
elvetica,sans-serif;color:#33333;margin-top:4px; }.emphasize
{ color:#333333;background-color:#C8E3FF;padding:5px;}
.note { color:#CC6600; }a { font-family:tahoma,helvetica,sans-
serif;text-decoration:underline;color:#336699; }a:vis
ited { color:#001166; }a:hover { text-decoration:none; }</style></
head><body><table cellpadding="0" cellspacing="0"
border="0" width="100%"><tr><td><h1>Anmeldung fehlgeschlagen</
h1><br><h2>Was ist passiert ?</h2><p>Der Aufruf der
URL http://erp.esworkplace.sap.com:50080/sap/bc/srt/xip/sap/ECC_MATERIALBYIDDESCR001QR
wurde aufgrund fehlerhafter
Anmeldedaten abgebrochen.</p></td></tr><tr><td>&nbsp;</td></tr><tr><td
class="emphasize"><strong>Hinweis</strong><b
r>Die Anmeldung wurde im System HU2 ausgef├╝hrt. Hierbei wurden keine
Anmeldedaten bereitgestellt.</td></tr><tr><td
>&nbsp;</td></tr><tr><td><p> &nbsp;</p><h2>Was k├Ânnen Sie tun ?</h2><ul><li> Falls Sie noch ├╝ber keine Benutzerke
nnung verf├╝gen, so wenden Sie sich an Ihren Systemadministrator. </
li></ul></br><p class="note">Fehlercode: ICF-LE
-http-c:800-l:-T:-C:3-U:-P:-L:6</p></br><p> HTTP 401 - Unauthorized</
br><p> Ihr SAP Internet Communication Framewor
k Team</p></td></tr></table></body></html>Exception
`HTTPClient::RetryableResponse' at c:/dev/ruby/lib/ruby/gems/1.
8/gems/httpclient-2.1.2/lib/httpclient.rb:2145 -
HTTPClient::RetryableResponse
= Request

POST http://erp.esworkplace.sap.com:80/sap/bc/srt/xip/sap/ECC_MATERIALBYIDDESCR001QR?sap-client=800
HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=utf-8
Cookie: sap-usercontext=sap-client=800
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
User-Agent: SOAP4R/1.5.8 (/187, ruby 1.8.6 (2007-03-13) [i386-
mswin32])
Date: Wed, 26 Sep 2007 14:23:38 GMT
Content-Length: 1349
Host: erp.esworkplace.sap.com

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:MaterialSimpleByIDAndDescriptionQuery_sync xmlns:n1="http://
sap.com/xi/SAPGlobal20/Global">
<MaterialSimpleSelectionByIDAndDescription>

<SelectionByMaterialInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
<LowerBoundaryMaterialInternalID
schemeID="schemeID1">MDE-001</LowerBoundaryMaterialInternalID>
<UpperBoundaryMaterialInternalID
schemeID="schemeID2">MDE-999</UpperBoundaryMaterialInternalID>
</SelectionByMaterialInternalID>
<SelectionByMaterialDescription>
<InclusionExclusionCode></InclusionExclusionCode>
<IntervalBoundaryTypeCode></IntervalBoundaryTypeCode>
<LowerBoundaryMaterialDescription></
LowerBoundaryMaterialDescription>
<UpperBoundaryMaterialDescription></
UpperBoundaryMaterialDescription>
</SelectionByMaterialDescription>
<MaximumNumberValue>5</MaximumNumberValue>

</MaterialSimpleSelectionByIDAndDescription>
</n1:MaterialSimpleByIDAndDescriptionQuery_sync>
</env:Body>
</env:Envelope>

= Response

HTTP/1.1 500 Internal Server Error
Date: Wed, 26 Sep 2007 14:27:56 GMT
Server: SAP Web Application Server (1.0;700)
content-type: text/xml; charset=utf-8
content-length: 567
sap-srt_id: 20070926/162734/v1.00_final_6.40/
DC6C3C9C742B4AF1A063001438C3BC08
set-cookie:
MYSAPSSO2=AjQxMDMBABhEADAANAA1ADcAMQA4ACAAIAAgACAAIAACAAY4ADAAMAADABBIAFUAMgAgACAAIAAgACAABAAYMgAwADAAN
wAwADkAMgA2ADEANAAyADcABQAEAAAACAYAAlgACQACRQAKAAxEMDQ1NzE4ICAgICALAANIVTIMAAhIVTIgICAgIA0ADDIwMDcwOTI2MTQyNw4AAP8B
mjCCAZYGCSqGSIb3DQEHAqCCAYcwggGDAgEBMQswCQYFKw4DAhoFADALBgkqhkiG9w0BBwExggFiMIIBXgIBATATMA4xDDAKBgNVBAMTA0lEMwIBADA
JBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwOTI2MTQyNzM0WjAjBgkqhkiG9w0BCQQxFgQUez
xW4vWHjnPtrLP1hPhhbQu750gwgacGBSsOAwIbMIGdAkEBJCURz
%2fpje3fJosEzDeeQlEpqN0zvFhgsYGOtU1%21ZPuzVOFz39U1C48NxqG8GiV9d5
Krj4X1V5PoFcuOp%21CMN4QIVAUnv0BeAVI%2fqSThfUTgTOLvhRFgPAkEA
%21JkiW6wAY01Fq5ZwLXvKUttk6uPxTzu4x0qo4o1B31yk6xy9ThKld0
lVnBcuY%2f3KgYF
%2f85vENdjxafz4zoYfpwQwMC4CFQEFZ9HFrlbxbIxEjXwThUhiiruPvwIVAPQrwo39d1LWtg8RmkB52yAdOMKk;
path=/; dom
ain=.esworkplace.sap.com
Age: 0
Connection: close
Via: HTTP/1.1 SAPwdf (Traffic-Server/5.2.5-59702 [c s f ])

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/
envelope/"><soap-env:Body><soap-env:Fault><fault

code>soap-env:Client</faultcode><faultstring xml:lang="en">Application

has thrown an exception</faultstring><detail
><nr1:StandardMessageFault xmlns:nr1="http://sap.com/xi/SAPGlobal20/Global"><standard><faultText>An exception with


the type CX_SY_DYNAMIC_OSQL_SYNTAX occurred, but was neither handled
locally, nor declared in a RAISING clause</fau
ltText></standard></nr1:StandardMessageFault></detail></soap-

env:Fault></soap-env:Body></soap-env:Envelope>! CONNEC
TION CLOSED

Exception `SOAP::FaultError' at c:/dev/ruby/lib/ruby/gems/1.8/gems/

soap4r-1.5.8/lib/soap/rpc/proxy.rb:189 - Applica
tion has thrown an exception

Exception `SOAP::FaultError' at c:/dev/ruby/lib/ruby/gems/1.8/gems/

soap4r-1.5.8/lib/soap/mapping/mapping.rb:118 - A
pplication has thrown an exception
#<SOAP::Mapping::Object:0x336c394>: Application has thrown an
exception (SOAP::FaultError)

Andre Kloth

unread,
Sep 26, 2007, 10:45:42 AM9/26/07
to soa...@googlegroups.com
Hi Tobi,

thanks for the complete dump. This looks different to your previously sent
SOAP messages, doesn't it? :-)

See comments below.

On Wednesday 26 September 2007, Tobi wrote:

> <?xml version="1.0" encoding="utf-8" ?>
> <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <env:Body>
> <n1:MaterialSimpleByIDAndDescriptionQuery_sync xmlns:n1="http://
> sap.com/xi/SAPGlobal20/Global">
> <MaterialSimpleSelectionByIDAndDescription>
> <SelectionByMaterialInternalID>
> <InclusionExclusionCode>I</InclusionExclusionCode>
> <IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
> <LowerBoundaryMaterialInternalID
> schemeID="schemeID1">MDE-001</LowerBoundaryMaterialInternalID>
> <UpperBoundaryMaterialInternalID
> schemeID="schemeID2">MDE-999</UpperBoundaryMaterialInternalID>
> </SelectionByMaterialInternalID>
> <SelectionByMaterialDescription>
> <InclusionExclusionCode></InclusionExclusionCode>
> <IntervalBoundaryTypeCode></IntervalBoundaryTypeCode>

This may be your problem. The type IntervalBoundaryTypeCode is defined as:

<xsd:simpleType name="IntervalBoundaryTypeCode">
<xsd:restriction base="xsd:token">
<xsd:length value="1"/>
</xsd:restriction>
</xsd:simpleType>

So it has a fixed length of 1 xsd:token. Try "3" like in your
SelectionByMaterialInternalID. The same applies to InclusionExclusionCode.
Its usage is optional in SelectionByMaterialDescription. However, if you
use it, it must have a lengh of 1 xsd:token as well. Try "I" like in the
block before or completely drop this element :)


HTH,
Andre'

signature.asc

Tobi

unread,
Sep 26, 2007, 10:48:02 AM9/26/07
to soap4r
Once again ... I still continue my research ;)

I tried to get a valid soap and I generated one with an SAP tool
called the Web Service Nagivater:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<yq1:MaterialSimpleByIDAndDescriptionQuery_sync xmlns:yq1="http://


sap.com/xi/SAPGlobal20/Global">
<MaterialSimpleSelectionByIDAndDescription>
<SelectionByMaterialInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>

<LowerBoundaryMaterialInternalID xmlns:pns="http://sap.com/
xi/EA-APPL/SE/Global" schemeID="" schemeAgencyID="">MDE-001</
LowerBoundaryMaterialInternalID>
<UpperBoundaryMaterialInternalID xmlns:pns="http://sap.com/
xi/EA-APPL/SE/Global" schemeID="" schemeAgencyID="">MDE-999</
UpperBoundaryMaterialInternalID>
</SelectionByMaterialInternalID>
<MaximumNumberValue>0</MaximumNumberValue>
</MaterialSimpleSelectionByIDAndDescription>
</yq1:MaterialSimpleByIDAndDescriptionQuery_sync>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The one above is valid and the following not:

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:MaterialSimpleByIDAndDescriptionQuery_sync xmlns:n1="http://
sap.com/xi/SAPGlobal20/Global">
<MaterialSimpleSelectionByIDAndDescription>
<SelectionByMaterialInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
<LowerBoundaryMaterialInternalID
schemeID="schemeID1">MDE-001</LowerBoundaryMaterialInternalID>
<UpperBoundaryMaterialInternalID
schemeID="schemeID2">MDE-999</UpperBoundaryMaterialInternalID>
</SelectionByMaterialInternalID>
<SelectionByMaterialDescription>
<InclusionExclusionCode></InclusionExclusionCode>
<IntervalBoundaryTypeCode></IntervalBoundaryTypeCode>
<LowerBoundaryMaterialDescription></
LowerBoundaryMaterialDescription>
<UpperBoundaryMaterialDescription></
UpperBoundaryMaterialDescription>
</SelectionByMaterialDescription>

<MaximumNumberValue>0</MaximumNumberValue>


</MaterialSimpleSelectionByIDAndDescription>
</n1:MaterialSimpleByIDAndDescriptionQuery_sync>
</env:Body>
</env:Envelope>

Seems to be an SAP bug. Are you of the same opinion?
THanks in advance.

Best regards,
Tobi

> POSThttp://erp.esworkplace.sap.com:80/sap/bc/srt/xip/sap/ECC_MATERIALBYID...

> URLhttp://erp.esworkplace.sap.com:50080/sap/bc/srt/xip/sap/ECC_MATERIALB...


> wurde aufgrund fehlerhafter
> Anmeldedaten abgebrochen.</p></td></tr><tr><td>&nbsp;</td></tr><tr><td
> class="emphasize"><strong>Hinweis</strong><b
> r>Die Anmeldung wurde im System HU2 ausgef├╝hrt. Hierbei wurden keine
> Anmeldedaten bereitgestellt.</td></tr><tr><td>&nbsp;</td></tr><tr><td><p> &nbsp;</p><h2>Was k├Ânnen Sie tun ?</h2><ul><li> Falls Sie noch ├╝ber keine Benutzerke
>
> nnung verf├╝gen, so wenden Sie sich an Ihren Systemadministrator. </
> li></ul></br><p class="note">Fehlercode: ICF-LE
> -http-c:800-l:-T:-C:3-U:-P:-L:6</p></br><p> HTTP 401 - Unauthorized</
> br><p> Ihr SAP Internet Communication Framewor
> k Team</p></td></tr></table></body></html>Exception
> `HTTPClient::RetryableResponse' at c:/dev/ruby/lib/ruby/gems/1.
> 8/gems/httpclient-2.1.2/lib/httpclient.rb:2145 -
> HTTPClient::RetryableResponse
> = Request
>

> POSThttp://erp.esworkplace.sap.com:80/sap/bc/srt/xip/sap/ECC_MATERIALBYID...

> ...
>
> Erfahren Sie mehr »

Andre Kloth

unread,
Sep 26, 2007, 10:57:53 AM9/26/07
to soa...@googlegroups.com
On Wednesday 26 September 2007, Tobi wrote:

> Once again ... I still continue my research ;)

Yeah, it's a little bit tricky in the beginning.

No, this time they are right (:

Take a look at the <SelectionByMaterialDescription> part. The child elements
are defined but empty. This does not correspond with the WSDL. See my last
mail :-)


Regards,
Andre'

signature.asc

Tobi

unread,
Sep 26, 2007, 11:02:38 AM9/26/07
to soap4r
Hi again,

you are right, that solved it. The values can not be empty. Here the
final code for the driver (for those who are interested and having the
same problem somewhen):

#!/usr/bin/env ruby
require 'defaultDriver.rb'

endpoint_url = ARGV.shift
obj =
MaterialSimpleByIDAndDescriptionQueryResponse_In.new(endpoint_url)

# run ruby with -d to see SOAP wiredumps.
obj.wiredump_dev = STDERR if $DEBUG

req = MaterialSimpleByIDAndDescriptionQueryMessage_sync.new

req.materialSimpleSelectionByIDAndDescription = id_and_desc =
MaterialSimpleByIDAndDescriptionQueryMessage_sync::MaterialSimpleSelectionByIDAndDescription.new

id_and_desc.selectionByMaterialInternalID << id =
MaterialSimpleByIDAndDescriptionQueryMessage_sync::MaterialSimpleSelectionByIDAndDescription::SelectionByMaterialInternalID.new

#id_and_desc.selectionByMaterialDescription << desc =
MaterialSimpleByIDAndDescriptionQueryMessage_sync::MaterialSimpleSelectionByIDAndDescription::SelectionByMaterialDescription.new

id.inclusionExclusionCode = 'I'
id.intervalBoundaryTypeCode = '3'
id.lowerBoundaryMaterialInternalID = id1 =

ProductInternalID.new('MDE-001')
id.upperBoundaryMaterialInternalID = id2 =
ProductInternalID.new('MDE-999')


id1.xmlattr_schemeID = 'schemeID1'
id2.xmlattr_schemeID = 'schemeID2'

#id1.xmlattr_schemeID = ''
#id2.xmlattr_schemeID = ''

#desc.inclusionExclusionCode = ''
#desc.intervalBoundaryTypeCode = ''
#desc.lowerBoundaryMaterialDescription = ''
#desc.upperBoundaryMaterialDescription = ''
#desc = nil

id_and_desc.maximumNumberValue = 0

#obj.test_loopback_response << '' # for test: causes
EmptyResponseError

puts obj.materialSimpleByIDAndDescriptionQueryResponse_In(req)

I'd like to thank both of you, Andre and NaHi. You helped me solving
my problem in less then 5h, thats better than any support center :).
And thanks NaHi for the great library. You are doing a good job!! :).

Best regards
Tobi

> signature.asc
> 1KHerunterladen

NAKAMURA, Hiroshi

unread,
Sep 26, 2007, 9:48:02 PM9/26/07
to soa...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Tobi wrote:
> I'd like to thank both of you, Andre and NaHi. You helped me solving
> my problem in less then 5h, thats better than any support center :).

Credit goes to Andre'. Knows much about WS and soap4r, and the good
catch and suggestion.

Hmm. Do you think soap4r should do validate a message against XML
Schema and stop/warn to help to construct sending message easier? If
constructing a message is not easier than XML DOM programming, why don't
you use REXML DOM for generating message and REXML XPath for parsing
message instead of soap4r?

7 years ago, I was bored to do XML DOM programming and surveyed
XML-to-programming language mapping scheme. XML Schema didn't have
Struct and Array and SOAP Encoding (section 5) was a supplement of it
(nothing changed now.) Across the ages people tend to use literal XML
instead of encoded but there should be easier way to do XML messaging
from programming language than DOM + XPath.

Regards,
// NaHi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRvsL0R9L2jg5EEGlAQILNAgAqEnyK8hZMff/9VX+xA4yEazk1SLG6KoA
0rl78WakVkCyEdrv7elJS03dKL01I5/vP66whJn+Suhb3HHF3uGLB8CCzhG8TaJ2
rwMZD9mO1iM4JIEwLTnET22tD2hJf/Ha64+Dz1Yj9hz+bzsk0BuSB8YFUDpMnuDa
bGvfBdB0XlXTY5AonUdPopMLrAyL6JQ5lsOzLQhQmqjPvOT2ph8qgzpiD9Q+63+E
aTpDgPe887bxhB3n8K8e/3jBQD79ghBtHxbycwV4GjaRd79BvtZyh2ZzgOaznIGs
A0Lh6i4Ri75HskFtV1FT/8n8yC4rrR77dvRJoQ4DmFdJSoUCnan+6Q==
=Amnl
-----END PGP SIGNATURE-----

Andre Kloth

unread,
Sep 26, 2007, 11:02:56 PM9/26/07
to soa...@googlegroups.com
On Thursday 27 September 2007, NAKAMURA, Hiroshi wrote:

> Credit goes to [...]

That was quite easy as I had to write a sample Rails application that
consumed some special SAP WS (ATP), some weeks ago.

The code is simple, but it's really tricky to build valid SOAP messages for
the SAP Web Service. The XML gets filled with lots of ABAP/SAP specific
values that only SAP consultants (want to/need to) know:

For example the following snippet

<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>

corresponds to an interval with a closed upper and lower interval
boundary; [X,Y] ... this is the meaning of 3 *OMG*

> Hmm. Do you think soap4r should do validate a message against XML
> Schema and stop/warn to help to construct sending message easier?

I would appreciate an "output validation". I prefer a warning, that can be
switched off e.g. by setting an objects attribute to something :)

> If constructing a message is not easier than XML DOM programming, why
> don't you use REXML DOM for generating message and REXML XPath for parsing
> message instead of soap4r?

I did not knew these APIs before. It would had been quite less work while
working on SAP WS some weeks ago ;)

> 7 years ago, I was bored to do XML DOM programming and surveyed
> XML-to-programming language mapping scheme. XML Schema didn't have
> Struct and Array and SOAP Encoding (section 5) was a supplement of it
> (nothing changed now.) Across the ages people tend to use literal XML
> instead of encoded but there should be easier way to do XML messaging
> from programming language than DOM + XPath.

That's right. In the end, this is very inefficient compared with every
binary format in terms of performance -- and I am not sure if one can debug
XML stuff faster than a known binary message.

Fortunately, I'm generally coding C for low-level/embedded devices :)


Best regards,
Andre'

signature.asc

Tobi

unread,
Sep 27, 2007, 3:55:10 AM9/27/07
to soap4r
Hi,

> Hmm. Do you think soap4r should do validate a message against XML
> Schema and stop/warn to help to construct sending message easier?

In my eyes a validation would be quite useful and a warning would be
better than an hard error, just as Andre said.

Best regards
Tobi

Reply all
Reply to author
Forward
0 new messages