cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptive Web Service won't work

Former Member
0 Kudos

Hi,

i'm currently developing an application using web dynpro JAVA and having some Problems with including a webservice. The Webservice takes a ID as argument and returns a detailed record with the Sales corresponding to this id. I'm using SAP NetWeaver 7.1 EhP 1 SP00 PAT0000.

I performed the following steps:

1. Imported the Model through a wsdl-File

2. Created a Logical Destination for this Webservice on my AS

3. I used the "Service Controller" - Template to generate the Context Bindings and the method for invoking the webservice.

4. I created a simple Form for entering the ID and a button whos actionmethod invokes the webservice.

5. Then when i'm deploying the project everything works fine until i click on the button and invoke the webservice. Following error is displayed.

Exception on execution of web service on destination SalesOrder_EXEC for operation SalesOrderByIDQueryResponseIn in interface {http://sap.com/xi/NWDemo}SalesOrderByIDQueryResponseIn

It would be really nice if someone has a solution or at least some ideas.

Greets

Carl Heckmann

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Carl,

After importing the model in Web Dynpro and generating the context binding with service controller you have to initialize the request part (request node and all subnodes in the request node) of the model in the wdDoinit method of the component controller. After this you can perform step 4 and deploy your application.

Please check the following links for detailed information.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2076831c-efce-2910-7582-ff2b4495...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0eeea30-f1ce-2910-c180-d5758441...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50038f8d-fbce-2910-e289-92154874...

Regards,

Yasar

Answers (12)

Answers (12)

Former Member
0 Kudos

Well, finally I figured out the problem. It laid inside the webservice or more precise in a difference between WSDL and webservice and a too strict interpretation from the web dynpro side.

The WSDL defined the length of an attribute inside the response to 3 characters, but the webservice only returns a value with one char. And now the web dynpro engine is complaining about that.

In my opinion this should be a warning but under no circumstances an exception.

Now I'm trying to solve the Problem through an "adapter" CAF-webservice. Hope it will work.

Greets,

Carl

Former Member
0 Kudos

I'm using a destination SaleOrder_LOCAL for Execution as well as for MetaData.

The Destination is from type WSDL with the following url:

http://iwdfvm1033.wdf.sap.corp:50000/SalesOrderByIDQueryResponseInService/SalesOrderByIDQueryRespons...

The timeout is the default 60sec value.

Additionally I have set the Authentication-Settings to HTTP and just entered the user data.

I also tested this destination with the wsnavigator and it worked.

Greets,

Carl

Former Member
0 Kudos

Hi Carl,

You are right, both request messages are same and should return the same response.

The only thing what I see is the logical destination configuration. Could you re-check this configuration?

Are you using Metadata and Execution destinations?

What is the URL for this Destinations?

Regards,

Yasar

Former Member
0 Kudos

Ok, that hint was really good.

But I still haven't solved my problem.

This is the request from the webservicenavigator which works:

<?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:SalesOrderByIDQuery xmlns:yq1="http://sap.com/xi/NWDemo">
      <SalesOrderSelectionByID>
        <ID xmlns:pns="http://sap.com/xi/BASIS/Global" schemeID="0" schemeAgencyID="0" schemeAgencySchemeAgencyID="0">50000000000</ID>
      </SalesOrderSelectionByID>
    </yq1:SalesOrderByIDQuery>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

and this is my applications request, which isn't even generating a response message.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<SOAP-ENV:Body>
		<yq1:SalesOrderByIDQuery xmlns:yq1='http://sap.com/xi/NWDemo'>
			<SalesOrderSeectionByID>
				<ID schemeID='0' schemeAgencyID='0' schemeAgencySchemeAgencyID='0' xmlns:pns='http://sap.com/xi/BASIS/Global'>5000000000</ID>
			</SalesOrderSelectionByID>
		</yq1:SalesOrderByIDQuery>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Am I wrong or should these both requests normally result in the same response?

Greets,

Carl

Former Member
0 Kudos

Hi Carl,

The problem you have is not directly related with the web dynpro view. Its more about the service you are consuming.

It is possible to change the trace level of the log viewer. If you can do this, you are also able to see the request and response messages for the service. If you could do this, it will simplify your search for the reason.

Regards,

Yasar

Former Member
0 Kudos

As far as i can see there is no additional dynpro stacktrace. Indeed the webdynpro page displays correctly. The errormessage I posted in my first post is only shown by the web dynpro MessageManager.

What's also strange is, that i found out, that the exception only occurs if I enter an id for a Sale, which exists.

Greets,

Carl

Former Member
0 Kudos

Carl,

This is the general part of the exception.

Could you please post the specific part of the exception, related with your web dynpro application?

Regards,

Yasar

Former Member
0 Kudos

This should be the Exception:

java.lang.NullPointerException 
at com.sap.esi.esp.service.server.SOATimeoutListenerImpl.process(SOATimeoutListenerImpl.java:187) 
at com.sap.esi.esp.service.server.SOATimeoutListenerImpl.run(SOATimeoutListenerImpl.java:74) 
at com.sap.esi.esp.service.server.SOATimeoutListenerImpl.timeout(SOATimeoutListenerImpl.java:55) 
at com.sap.esi.esp.service.server.SOATimeoutListenerImpl.timeout(SOATimeoutListenerImpl.java:43) 
at com.sap.engine.services.timeout.TimeoutNode.run(TimeoutNode.java:71) 
at com.sap.engine.frame.core.thread.Task.run(Task.java:73) 
at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:162) 
at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:260)

I hope you get more information out of it than me

Greets,

Carl.

Edited by: Carl Simon Heckmann on Jul 16, 2008 10:23 AM

Former Member
0 Kudos

Hi Carl,

If you trigger the error on the portal and check the Log Viewer on Netweaver Administrator, you can retrieve the exception in details.

Is it possible to put this exception here?

Regards,

Yasar

Former Member
0 Kudos

Well there are a bunch of logfiles, i don't know which one would helpful for you and all of them would be definately too much too insert here. If you could tell me which one would help you I will post it in here.

Former Member
0 Kudos

Hi Carl,

Could you please post the log of the error?

In the log you can find a detailed description of your problem.

Regards,

Yasar

Former Member
0 Kudos

First of all, thanks for your quick reply.

I already found and read the resources you gave me and I think you're missing something like that:

//$$begin Service Controller(-1574168931)
    SaleByIdModel saleByIdModelModel = new SaleByIdModel();
    request_SalesOrderByIDQueryResponseIn = new Request_SalesOrderByIDQueryResponseIn(saleByIdModelModel);
    Response_SalesOrderByIDQueryResponseIn response = new Response_SalesOrderByIDQueryResponseIn(saleByIdModelModel);
    request_SalesOrderByIDQueryResponseIn.setResponse(response);
    SalesOrderByIDResponse salesOrderByIDResponse = new SalesOrderByIDResponse(saleByIdModelModel);
    response.setSalesOrderByIDResponse(salesOrderByIDResponse);
    SalesOrder salesOrder = new SalesOrder(saleByIdModelModel);
    salesOrderByIDResponse.setSalesOrder(salesOrder);
    SalesOrderByIDQuery salesOrderByIDQuery = new SalesOrderByIDQuery(saleByIdModelModel);
    request_SalesOrderByIDQueryResponseIn.setSalesOrderByIDQuery(salesOrderByIDQuery);
    SalesOrderSelectionByID salesOrderSelectionByID = new SalesOrderSelectionByID(saleByIdModelModel);
    salesOrderByIDQuery.setSalesOrderSelectionByID(salesOrderSelectionByID);
    BusinessTransactionDocumentID iD_1 = new BusinessTransactionDocumentID(saleByIdModelModel);
 
    salesOrderSelectionByID.setID(iD_1);
    wdContext.nodeRequest_SalesOrderByIDQueryResponseIn().bind(request_SalesOrderByIDQueryResponseIn);
    //$$end

This was already generated through the Service Controller Template.

Another thing I should mention is the fact, that another webservice worked , when I included it exactly the same way like I did it here. But the webservice is correct, I can verify it by executing it through the webservice navigator.