• S-Controls
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 10
    Replies
Hi
I'm new to Apex development.
I'm trying to communicate from Apex to external Web Service.

I'm able to access the Web Service from some other Java client without any issues.
But while accessing the same Web Service from the Apex code, I'm getting the following error.

Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':html'

And I verified the SOAP request and response messages , they look good.
Here I'm copying them

SOAP Request
-----------------------------------------------------------------------------------------------
POST http://localhost:8080/Axis/services/SecondServiceSOAP HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.3

Host: localhost:8080

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 356

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:concatRequest xmlns:ns1="http://ttdev.com/ss">
<s1>abc</s1>
<s2>124</s2>
</ns1:concatRequest>
</soapenv:Body>
</soapenv:Envelope>
--------------------------------------------------------------------------------------------------------


SOAP Response
--------------------------------------------------------------------------------------------------------

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

Content-Type: text/xml;charset=utf-8

Date: Tue, 22 Jan 2008 22:38:14 GMT

Connection: close



<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<concatResponse xmlns="http://ttdev.com/ss">
<companyName xmlns="">abc124</companyName>
</concatResponse>
</soapenv:Body>
</soapenv:Envelope>
-----------------------------------------------------------------------------------------------------

I'm using Axis1.3 and Tomcat 5.5 on SalesForce 8.

The Apex version and the endpoint version are 11.1

Can you please help me in solving this issue at the earliest.

Thanks
Sarada


Hi
I'm new to Apex development.
I'm trying to communicate from Apex to external Web Service.

I'm able to access the Web Service from some other Java client without any issues.
But while accessing the same Web Service from the Apex code, I'm getting the following error.

Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':html'

And I verified the SOAP request and response messages , they look good.
Here I'm copying them

SOAP Request
-----------------------------------------------------------------------------------------------
POST http://localhost:8080/Axis/services/SecondServiceSOAP HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.3

Host: localhost:8080

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 356

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:concatRequest xmlns:ns1="http://ttdev.com/ss">
<s1>abc</s1>
<s2>124</s2>
</ns1:concatRequest>
</soapenv:Body>
</soapenv:Envelope>
--------------------------------------------------------------------------------------------------------


SOAP Response
--------------------------------------------------------------------------------------------------------

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

Content-Type: text/xml;charset=utf-8

Date: Tue, 22 Jan 2008 22:38:14 GMT

Connection: close



<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<concatResponse xmlns="http://ttdev.com/ss">
<companyName xmlns="">abc124</companyName>
</concatResponse>
</soapenv:Body>
</soapenv:Envelope>
-----------------------------------------------------------------------------------------------------

I'm using Axis1.3 and Tomcat 5.5 on SalesForce 8.

The Apex version and the endpoint version are 11.1

Can you please help me in solving this issue at the earliest.

Thanks
Sarada