cancel
Showing results for 
Search instead for 
Did you mean: 

Problem about "proxy to web service"

Former Member
0 Kudos

Hi, I designed a scenario to test proxy2WS but faced a problem, my steps design are as follows:

1. import the WSDL file

2. create 2 message types (request and response)

3. create a outbound service interface which use the message types

4. create a inbound service interface which use the external message from imported WSDL file

5. create a request message mapping between the designed request message designed by myself and the external request message imported

6. create a response message mapping between the designed response message designed by myself and the external response message imported

7. create a interface mapping between the outbound and inbound messages and use the message mappings for them

8. config the necessary elements in the configuration time

9. generate ABAP proxy code to test proxy2WS

Exception raised: Während des Anwendungs-Mappings com/sap/xi/tf/_ZHello_Response_Mapping_ ist eine RuntimeException aufgetreten. com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns1:ZHello_Response. Values missing in queue context. Target XSD ~

when I used SXMB_MONI to see the trace of the calling, I found that the return result is correct, but failed when transforming the result to the message type that we designed by myself.

Could anyone help me to solve the problem? Thanks a lot.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member187339
Active Contributor
0 Kudos

Hi,

Check your ZHelloResponse_Mapping mapping.

Check whether all elements having minoccurs 1 is created or not.

Regards

Suraj

Former Member
0 Kudos

I think that the mapping is correct, in the mapping design, the source message is the external message type that imported from the WSDL and the target message is that we designed by myself, I have test it and the result is correct.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Use this blog by Michal to test your request and response mapping . Looks like there is some issue with the response mapping,

/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios

Regards,

Bhavesh

Former Member
0 Kudos

The error message is the same as the message in the SXMB_MONI.

former_member187339
Active Contributor
0 Kudos

Hi,

Can you post here the response XML message and the Target MT of response mapping.

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

response XML message:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><rpl:getStrResponse xmlns:rpl='urn:SimpleWSSi' 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'><Response>Hello, Kevin</Response></rpl:getStrResponse>

Target MT:

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

<xsd:schema targetNamespace="http://sap.com/xi/A1S" xmlns="http://sap.com/xi/A1S" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="ZHello_Response" type="par"/>

<xsd:simpleType name="par">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/VersionID">c84e727164c911db9c4900132169e07b</xsd:appinfo>

</xsd:annotation>

<xsd:restriction base="xsd:string"/>

</xsd:simpleType>

</xsd:schema>

Thanks and regards,

Bean

Former Member
0 Kudos

By the way, the 'par' is a data type, it is just a string type.

Former Member
0 Kudos

The source MT is:

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

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="getStrResponse">

<xsd:annotation>

<xsd:documentation>Comment describing your root element</xsd:documentation>

</xsd:annotation>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="response" type="xsd:string" form="qualified"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:schema>

When I test in the design time when using such data, it runs succefully.

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

<getStrResponse>

<response>aaa</response>

</getStrResponse>

But when I use the response message, it runs failed.

Former Member
0 Kudos

Error message when I test transforming the response message to the MT in design time:

18:11:01 Start of test

Cannot create target element /ns0:ZHello_Response. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns0:ZHello_Response. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD at com.sap.aii.mappingtool.tf7.AMappingProgram.processNode(AMappingProgram.java:328) at com.sap.aii.mappingtool.tf7.AMappingProgram.start(AMappingProgram.java:460) at com.sap.aii.mappingtool.tf7.Transformer.start(Transformer.java:137) at com.sap.aii.mappingtool.tf7.AMappingProgram.transform(AMappingProgram.java:579) at com.sap.aii.ibrep.server.mapping.exec.ExecuteXiMappingCommand.transformInternal(ExecuteXiMappingCommand.java:197) at com.sap.aii.ibrep.server.mapping.exec.ExecuteXiMappingCommand.execute(ExecuteXiMappingCommand.java:94) at com.sap.aii.ib.server.mapping.exec.CommandManager.execute(CommandManager.java:43) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:40) at com.sap.aii.ibrep.server.mapping.MapServiceBean.execute(MapServiceBean.java:40) at sun.reflect.GeneratedMethodAccessor849_10001.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:43) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:101) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:92) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:26) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:101) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:92) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:28) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:101) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:92) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:109) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:15) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:101) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:92) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:20) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:101) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:92) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_RemoteExceptionConverter.invoke(Interceptors_RemoteExceptionConverter.java:24) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:101) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:92) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:14) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:101) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:92) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:128) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:174) at $Proxy274_10001.execute(Unknown Source) at sun.reflect.GeneratedMethodAccessor848_10001.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:196) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:227) at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:59) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:140) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:227) Cannot create target element /ns0:ZHello_Response. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD

18:11:01 End of test

former_member187339
Active Contributor
0 Kudos

Hi,

This structure ZHello_Response should be of complex type. ie it should be like

<u><b>Target</b></u>

ZHello_Response

--- response_message

<u><b>Source</b></u>

getStrResponse

--- response

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Thanks a lot for your help.

I have tried following your instruction, it failed either, but I think that maybe I have find why this occurred, currently I haven't solve it, could you please give me some idea?

I have modify the definition of the ZHello_Response and it acts as the target MT in the response mapping.

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

<xsd:schema targetNamespace="http://sap.com/xi/A1S" xmlns="http://sap.com/xi/A1S" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="ZHello_Response" type="DT_string"/>

<xsd:complexType name="DT_string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/VersionID">a97aeb6165b611dbb4c500132169e07b</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="par" type="xsd:string"/>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

The source MT definition:

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

<xsd:schema targetNamespace="urn:SimpleWSSi" xmlns="urn:SimpleWSSi" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="getStrResponse">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="Response" type="xsd:string" form="qualified" nillable="true"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:schema>

The response message:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!-- Inbound Message --> <rpl:getStrResponse xmlns:rpl='urn:SimpleWSSi' 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'><Response>Hello, Kevin</Response></rpl:getStrResponse>

It will raise exception either, but if I add the namespace to the node 'Response', that is change the <Response> to <rpl:Response>, it will runs successfully. But as you know, the definition is imported from the WSDL, so how can I solve it? Should I Define the external message type by meyself?

Thanks adn regards,

Bean

former_member187339
Active Contributor
0 Kudos

Hi,

One doubt, are you cresting this structure:

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

<xsd:schema targetNamespace="urn:SimpleWSSi" xmlns="urn:SimpleWSSi" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="getStrResponse">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="Response" type="xsd:string" form="qualified" nillable="true"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:schema>

When you import the wsdl, you will get both the request and response message types. You just have to create the MI. Yes for proxy you have to create MT's

So are you creating manually any MT's? Just remove this namespace:

urn:SimpleWSSi, from the XML Namespace text box of MT. And I think your problme will be solved.

Regards

Suraj

Former Member
0 Kudos

Hi,

The MT is not created manually, it is the response message imported from the WSDL and I get its definition when I design the response MT mapping, it has a 'src' view, I get the definition throught that.

Regards,

Bean

former_member187339
Active Contributor
0 Kudos

Hi,

Two methods:

1) Edit this MT

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

<xsd:schema targetNamespace="http://sap.com/xi/A1S" xmlns="http://sap.com/xi/A1S" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="ZHello_Response" type="DT_string"/>

<xsd:complexType name="DT_string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/VersionID">a97aeb6165b611dbb4c500132169e07b</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="par" type="xsd:string"/>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

Include the namespace 'urn:SimpleWSSi' while creating ZHello_Response MT.

or

2) Edit the wsdl and remove targetNamespace="urn:SimpleWSSi" from it.

I think this should do the trick

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

1. The XSD source file is generated automatically and can't be modified.

2. I think it will be a terrible work when import the WSDL if we have to modify it each time.

And I find in the response message, the node 'getStrResponse' has the namespace, but the sub-node 'Response' doesn't have, why this happens? And can we make it generate the namespace correctly?

former_member187339
Active Contributor
0 Kudos

Hi,

>>The XSD source file is generated automatically and can't be modified.

Why? you are importing it into XI right? Before importing edit it using wordpad.

>> I think it will be a terrible work when import the WSDL if we have to modify it each time.

Either of the method you have to choose

>>And I find in the response message, the node 'getStrResponse' has the namespace, but the sub-node 'Response' doesn't have, why this happens? And can we make it generate the namespace correctly?

Search the forum i think there was a thread on this and the final conclusion was its not possible.

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

>>The XSD source file is generated automatically and can't be modified.

Why? you are importing it into XI right? Before importing edit it using wordpad.

The MT you metioned is the response MT of the outbound MI and it is designed by myself, not imported into the XI. The MTs that are imported into XI is from the WSDL and used for the inbound MI. So it tis designed in the UI and the XSD source can not be changed.

former_member187339
Active Contributor
0 Kudos

Hi,

>>The MT you metioned is the response MT of the outbound MI and it is designed by myself, not imported into the XI.

ie this MT : ZHello_Response MT was created by you, so include the namespace 'urn:SimpleWSSi' while creating ZHello_Response MT (While creating ZHello_Response MT in the text box named XML Namespaces write 'urn:SimpleWSSi' ).

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

I've tried this last week, but unfortunately had no effect, it raised the same exception.

I have finished a test just now, I verified the response message through the response MT in the XML Spy and it reported me that the message is invalid, the "response" node should have the "rpl" namespace. Then I test the WSDL in the XML Spy, the "response" node of the response message from it has the namespace, so why the response message from XI lost the namspace?

Thanks and regards,

Bean