cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP receiver - java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 401 Unauthorized

former_member229310
Active Participant
0 Kudos

Hello

I have ABAP Proxy to SOAP sceanrio. While posting to the target URL i am receiving following message in the receiver soap communcation channel.

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 401 Unauthorized

SOAP: call failed: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 401 Unauthorized

When I tried on PI server pasting this URL it gives me the windows pop up for credentials and upon providing the username and password it works.

But whereas I provide the same credentials in the communication channel during posting it displays the above message.

Also I tried providing the below module as well ,

localejbs/AF_Modules/MessageTransformBean     L        MSG

module Key

MSG                 Transform.ContentType            text/xml

But no luck.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi,

What do you mean by saying that "it works in web browser"? My suspiction is that you are putting the .wsdl location in the receiver Communication Channel, which is incorrect, and since you do that, you display the wsdl in the browser after you provide user credentials. Am I right? Does your URL in receiver CC end with "?WSDL"? If so, change the URL to what is mentioned in the following tag of the wsdl file:

<soap:address location="HERE" />

Hope this helps,
Greg

former_member229310
Active Participant
0 Kudos

Hi Greg,

Thanks for the reply.

I tried making the changes as requested.

Below is the target URL that I used in the receiver CC.

http://host/maximo/GR.asmx="HERE"

After using above I received

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 400 Bad Request

As the CC says content invalid do i need to add the modules in the CC.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Can you also consult with your network team if your PI system is using proxy connection?

Regards,

Mark

Message was edited by: Mark Angelo Dihiansan

former_member184681
Active Contributor
0 Kudos

I'm afraid that I did not make myself clear, looking at your reply. If your URL was: http://host/maximo/GR.asmx, then most probably no further adjustments should be required to it. Try doing what Michal has suggested: import the .wsdl file to SOAP UI or other web service testing tool and test from there, then let us know about the results.

former_member229310
Active Participant
0 Kudos

Hi Mark,

I logged into PI server and pasted the target URL in IE and pop displayed and gave user credentials it displayed the target strucutre correctly.

There is no proxy connection used in the PI server.

former_member229310
Active Participant
0 Kudos

Thanks for the replies.  As said by Mich I tried using the SOAP UI, I get the below message           

     

      
           
            

401 - Unauthorized: Access is denied due to invalid credentials.

            

You do not have permission to view this directory or page using the credentials that you supplied.

           
       
     

      Where as when I try to paste the same end point URL in the internet explorer and provide the same credentials it shows the target structure. i do not get any unauthorization. I tried this in PI serve internet explorer and local Internet explorer also both worked opening the target strucute.   But when I am trying post by SOAP communication channel and by using SOAP UI i get the 401 error.

former_member229310
Active Participant
0 Kudos

Is this because end point URL that my user gave me does not support the SOAP format and hence I am receiving "java.io.IOException: invalid content type for SOAP: TEXT/XML;HTTP 401 Unauthorized"  It says invalid content type does this have to do anything related to modules that I need to add in the SOAP receiver CC.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Questions:

>Where as when I try to paste the same end point URL in the internet explorer and provide the same credentials it shows the target structure.

Do you get the response data of the webservice? If so then the problem is weird.  I think it shows only the WSDL structures. This does not validate your credentials to return the response. Please confirm.

During your soap UI testing, did you input the user credentials at the right place?

If soapui and communication channel gives the same results that means clearly something wrong with user credentials. Also you might want to refresh cache and restart the soap channel too.

former_member229310
Active Participant
0 Kudos

Thanks for the inputs.  --  --> Do you get the response data of the webservice? If so then the problem is weird.  I think it shows only the WSDL structures. This does not validate your credentials to return the response. Please confirm.     Yes it shows the WSDL target structure.  This is a asynchronous message.  I am not sure if there would be any further authentication at external system. But in Internet explorer after giving credentials it shows the target strucutre.     -- > During your soap UI testing, did you input the user credentials at the right place?    Yes i placed the credentials at the left hand bottom of the screen under request properties of SOAP UI tool.

former_member229310
Active Participant
0 Kudos

Also further looking at the SOAP UI error                                   Same content type error followed by unauthorization is seen so do i need to add any modules in CC. something like text/xml or text/html.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You might want to check this link? When you send via browser you might send as application/xml?

http://scn.sap.com/message/2422573

Answers (4)

Answers (4)

aashish_sinha
Active Contributor
0 Kudos

Hi,

Please check following -

1. Incorrect URL

2. You are not behind some kind of firewall that is stopping you to reach there.

3.User Authentication.

regards

Aashish Sinha

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>When I tried on PI server pasting this URL it gives me the windows pop up for credentials and upon providing the username and password it works.

you can see this when you put the SOAP URL in the browser ?

this is strange... it should not be happening as you're not accessing the WSDL with credentials...

can you try using this Web service with SOAP UI (free tool) ? put the WSDL there and try sending the message,

Regards,

Michal Krawczyk

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

By chance, are you using dynamic configuration? If yes, then instead of using the username/password authentication in SOAP Receiver CC, you need to place them in the Authentication Keys (under advanced tab). Then in your dynamic configuration, pass the username by using TAuthKey as the technical name.

Hope this helps,

Mark

Former Member
0 Kudos

just check whether username and password in receiver SOAP comm channel is maintained correctly.

also username - can have a domain name followed by backslash then username, if needed. just check it.

Also ask your basis team to do a full CPACache refresh using http://hostname:j2eeport/CPACache/refresh?mode=full using PIDIRUSER and see if there is any error in it. if it is successful, then test your scenario again.