- This topic has 2 replies, 2 voices, and was last updated 16 years, 3 months ago by Loyal Water.
-
AuthorPosts
-
8alotMemberI am missing <?xml version=”1.0″ encoding=”UTF-8″?> from the response my webservice sends back to the client. How do I add it (to the webservice response)?
Some information: I have MyEclipse 6.0.1. I used the Web Service Project and Web Service wizards (WSDL First) to create my web service which generated almost all of my web service (very nice). It uses XFire 1.2. I followed the steps in your “MyEclipse Web Services Overview” tutorial. I am deploying to a Glassfish 2 server. I used the “MyEclipse Application Server Tutorial” to set Glassfish up with my IDE.
Below are my Installation details:
*** Date:
Thursday, August 7, 2008 9:56:11 AM MDT** System properties:
OS=WindowsXP
OS version=5.1
Java version=1.5.0_11*** MyEclipse details:
MyEclipse Enterprise Workbench
Version: 6.0.1 GA
Build id: 6.0.1-GA-200710*** Eclipse details:
MyEclipse Enterprise WorkbenchVersion: 6.0.1 GA
Build id: 6.0.1-GA-200710Eclipse Graphical Editing Framework
Version: 3.3.1.v20070814
Build id: 20070814-1555Eclipse Platform
Version: 3.3.1.R33x_r20070911-_19UEkpF-B7Uh2hKy75y
Build id: M20070921-1145Eclipse RCP
Version: 3.3.1.R33x_r20070802-8y8eE8sEV3Fz0z0GlHJrXvTAUS
Build id: M20070921-1145Eclipse Java Development Tools
Version: 3.3.1.r331_v20070629-7o7jE72EDlXAbqAcnbmyg1rf8RIL
Build id: M20070921-1145Eclipse Plug-in Development Environment
Version: 3.3.1.R33x_r20070802-7N7M3D1VIA_52JsDFsEC
Build id: M20070921-1145Eclipse Project SDK
Version: 3.3.1.R33x_r20070802-7M7J78_mu1mnlRa7A4Ns52XeZ6D0
Build id: M20070921-1145Eclipse startup command=-os
win32
-ws
win32
-arch
x86
-showsplash
-launcher
C:\Program Files\MyEclipse 6.0\eclipse\eclipse.exe
-name
Eclipse
–launcher.library
C:\Program Files\MyEclipse 6.0\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.1.R33x_v20070828\eclipse_1020.dll
-startup
C:\Program Files\MyEclipse 6.0\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar
-exitdata
420_7c
-vm
C:\Program Files\MyEclipse 6.0\jre\bin\javaw.exeBelow is the “Request” and the web service “Respose” which I received from our customers that use the web service:
——————————————————————————–
Request 1 of 1 sent 2008-08-05 13:16:26.843:
——————————————————————————–
POST /VIV/services/VerifyService HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/*
Accept-Encoding: identity
User-Agent: VeriSol VIV Engine/1.5.3
Host: 67.108.240.41:80
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: “http://tempuri.org/VerifyInsurance”
Content-Length: 1003<?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><CoverageRequest xmlns=”http://www.iicmva.com/CoverageVerification/”><RequestorInformation><Organization><Name>WYDOT</Name></Organization><ReasonDetails><ReasonCode>CoverageVerification</ReasonCode><TrackingNumber>20080805-191626-218-104-3</TrackingNumber></ReasonDetails></RequestorInformation><Detail><PolicyInformation><OrganizationDetails><NAIC>29440</NAIC></OrganizationDetails><PolicyDetails><VerificationDate>2008-08-05T00:00:00.000</VerificationDate><UniqueKey>XXXXXXXX</UniqueKey><PolicyState>WY</PolicyState></PolicyDetails></PolicyInformation><VehicleInformation><VehicleDetails><VIN>xxxxxxxxxxxxxxxxx</VIN><Make>UNKNOWN</Make><Model>UNKNOWN</Model><Year>0000</Year></VehicleDetails></VehicleInformation></Detail></CoverageRequest></soapenv:Body></soapenv:Envelope>
——————————————————————————–
Response 1 of 1 received 2008-08-05 13:16:27.687:
——————————————————————————–
HTTP/1.1 200 OK
Date: Tue, 05 Aug 2008 19:22:15 GMT
Server: IBM_HTTP_Server/2.0.47.1-PK29827 Apache/2.0.47 (Unix) DAV/2
X-Powered-By: Servlet/2.5
Transfer-Encoding: chunked
Content-Type: text/xml;charset=UTF-8ec
<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”><soap:Body xmlns:ns1=”http://www.iicmva.com/CoverageVerification/”>
2a3
<CoverageResponse xmlns=”http://www.iicmva.com/CoverageVerification/”><RequestorInformation><ReasonDetails><TrackingNumber>20080805-191626-218-104-3</TrackingNumber></ReasonDetails></RequestorInformation><Detail><PolicyInformation><CoverageStatus><ResponseDetails><ResponseCode>Unconfirmed</ResponseCode><UnconfirmedReasonCode>9</UnconfirmedReasonCode></ResponseDetails></CoverageStatus><OrganizationDetails><NAIC>29440</NAIC></OrganizationDetails><PolicyDetails><VerificationDate>2008-08-05T00:00:00.000</VerificationDate><UniqueKey>CP000056</UniqueKey><PolicyState>WY</PolicyState></PolicyDetails></PolicyInformation></Detail></CoverageResponse></soap:Body></soap:Envelope>
0
——————————————————————————–One last comment: In the response above, right above the SOAP Envelope their is an “ec” and several lines below that there is “2a3” and at the bottom there a “0”. When I test my web service and view the response I do not get any of these and I do not know what they represent. I also do not get <?xml version=”1.0″ encoding=”UTF-8″?> in the tests I run either when using soapUI 2.0.2 (freeware client) to hit my web service (deployed to Glassfish) on my personal machine or on the server (not my personal computer) I have my .war deployed to (also on Glassfish).
Below is what I get as a typical response from my web service when hitting it on our server. You can see that <?xml version=”1.0″ encoding=”UTF-8″?> is missing.
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Thu, 07 Aug 2008 13:22:09 GMT
Content-Type: text/xml;charset=UTF-8
X-Powered-By: Servlet/2.5
Server: IBM_HTTP_Server/2.0.47.1-PK29827 Apache/2.0.47 (Unix) DAV/2<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”><soap:Body xmlns:ns1=”http://www.iicmva.com/CoverageVerification/”><CoverageResponse xmlns=”http://www.iicmva.com/CoverageVerification/”><RequestorInformation><ReasonDetails><TrackingNumber>TestFromSoapUI</TrackingNumber></ReasonDetails></RequestorInformation><Detail><PolicyInformation><CoverageStatus><ResponseDetails><ResponseCode>Confirmed</ResponseCode><UnconfirmedReasonCode>3</UnconfirmedReasonCode><UnconfirmedReasonCode>2</UnconfirmedReasonCode></ResponseDetails></CoverageStatus><OrganizationDetails><NAIC/></OrganizationDetails><PolicyDetails><VerificationDate>2008-08-05T08:30:00.359-06:00</VerificationDate><UniqueKey>20096226</UniqueKey><PolicyState>WY</PolicyState></PolicyDetails></PolicyInformation></Detail></CoverageResponse></soap:Body></soap:Envelope>
8alotMember@8alot wrote:
I am missing <?xml version=”1.0″ encoding=”UTF-8″?> from the response my webservice sends back to the client. How do I add it (to the webservice response)?
Some information: I have MyEclipse 6.0.1. I used the Web Service Project and Web Service wizards (WSDL First) to create my web service which generated almost all of my web service (very nice). It uses XFire 1.2. I followed the steps in your “MyEclipse Web Services Overview” tutorial. I am deploying to a Glassfish 2 server. I used the “MyEclipse Application Server Tutorial” to set Glassfish up with my IDE.
Below are my Installation details:
*** Date:
Thursday, August 7, 2008 9:56:11 AM MDT** System properties:
OS=WindowsXP
OS version=5.1
Java version=1.5.0_11*** MyEclipse details:
MyEclipse Enterprise Workbench
Version: 6.0.1 GA
Build id: 6.0.1-GA-200710*** Eclipse details:
MyEclipse Enterprise WorkbenchVersion: 6.0.1 GA
Build id: 6.0.1-GA-200710Eclipse Graphical Editing Framework
Version: 3.3.1.v20070814
Build id: 20070814-1555Eclipse Platform
Version: 3.3.1.R33x_r20070911-_19UEkpF-B7Uh2hKy75y
Build id: M20070921-1145Eclipse RCP
Version: 3.3.1.R33x_r20070802-8y8eE8sEV3Fz0z0GlHJrXvTAUS
Build id: M20070921-1145Eclipse Java Development Tools
Version: 3.3.1.r331_v20070629-7o7jE72EDlXAbqAcnbmyg1rf8RIL
Build id: M20070921-1145Eclipse Plug-in Development Environment
Version: 3.3.1.R33x_r20070802-7N7M3D1VIA_52JsDFsEC
Build id: M20070921-1145Eclipse Project SDK
Version: 3.3.1.R33x_r20070802-7M7J78_mu1mnlRa7A4Ns52XeZ6D0
Build id: M20070921-1145Eclipse startup command=-os
win32
-ws
win32
-arch
x86
-showsplash
-launcher
C:\Program Files\MyEclipse 6.0\eclipse\eclipse.exe
-name
Eclipse
–launcher.library
C:\Program Files\MyEclipse 6.0\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.1.R33x_v20070828\eclipse_1020.dll
-startup
C:\Program Files\MyEclipse 6.0\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar
-exitdata
420_7c
-vm
C:\Program Files\MyEclipse 6.0\jre\bin\javaw.exeBelow is the “Request” and the web service “Respose” which I received from our customers that use the web service:
——————————————————————————–
Request 1 of 1 sent 2008-08-05 13:16:26.843:
——————————————————————————–
POST /VIV/services/VerifyService HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/*
Accept-Encoding: identity
User-Agent: VeriSol VIV Engine/1.5.3
Host: 67.108.240.41:80
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: “http://tempuri.org/VerifyInsurance”
Content-Length: 1003<?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><CoverageRequest xmlns=”http://www.iicmva.com/CoverageVerification/”><RequestorInformation><Organization><Name>WYDOT</Name></Organization><ReasonDetails><ReasonCode>CoverageVerification</ReasonCode><TrackingNumber>20080805-191626-218-104-3</TrackingNumber></ReasonDetails></RequestorInformation><Detail><PolicyInformation><OrganizationDetails><NAIC>29440</NAIC></OrganizationDetails><PolicyDetails><VerificationDate>2008-08-05T00:00:00.000</VerificationDate><UniqueKey>XXXXXXXX</UniqueKey><PolicyState>WY</PolicyState></PolicyDetails></PolicyInformation><VehicleInformation><VehicleDetails><VIN>xxxxxxxxxxxxxxxxx</VIN><Make>UNKNOWN</Make><Model>UNKNOWN</Model><Year>0000</Year></VehicleDetails></VehicleInformation></Detail></CoverageRequest></soapenv:Body></soapenv:Envelope>
——————————————————————————–
Response 1 of 1 received 2008-08-05 13:16:27.687:
——————————————————————————–
HTTP/1.1 200 OK
Date: Tue, 05 Aug 2008 19:22:15 GMT
Server: IBM_HTTP_Server/2.0.47.1-PK29827 Apache/2.0.47 (Unix) DAV/2
X-Powered-By: Servlet/2.5
Transfer-Encoding: chunked
Content-Type: text/xml;charset=UTF-8ec
<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”><soap:Body xmlns:ns1=”http://www.iicmva.com/CoverageVerification/”>
2a3
<CoverageResponse xmlns=”http://www.iicmva.com/CoverageVerification/”><RequestorInformation><ReasonDetails><TrackingNumber>20080805-191626-218-104-3</TrackingNumber></ReasonDetails></RequestorInformation><Detail><PolicyInformation><CoverageStatus><ResponseDetails><ResponseCode>Unconfirmed</ResponseCode><UnconfirmedReasonCode>9</UnconfirmedReasonCode></ResponseDetails></CoverageStatus><OrganizationDetails><NAIC>29440</NAIC></OrganizationDetails><PolicyDetails><VerificationDate>2008-08-05T00:00:00.000</VerificationDate><UniqueKey>CP000056</UniqueKey><PolicyState>WY</PolicyState></PolicyDetails></PolicyInformation></Detail></CoverageResponse></soap:Body></soap:Envelope>
0
——————————————————————————–One last comment: In the response above, right above the SOAP Envelope their is an “ec” and several lines below that there is “2a3” and at the bottom there a “0”. When I test my web service and view the response I do not get any of these and I do not know what they represent. I also do not get <?xml version=”1.0″ encoding=”UTF-8″?> in the tests I run either when using soapUI 2.0.2 (freeware client) to hit my web service (deployed to Glassfish) on my personal machine or on the server (not my personal computer) I have my .war deployed to (also on Glassfish).
Below is what I get as a typical response from my web service when hitting it on our server. You can see that <?xml version=”1.0″ encoding=”UTF-8″?> is missing.
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Thu, 07 Aug 2008 13:22:09 GMT
Content-Type: text/xml;charset=UTF-8
X-Powered-By: Servlet/2.5
Server: IBM_HTTP_Server/2.0.47.1-PK29827 Apache/2.0.47 (Unix) DAV/2<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”><soap:Body xmlns:ns1=”http://www.iicmva.com/CoverageVerification/”><CoverageResponse xmlns=”http://www.iicmva.com/CoverageVerification/”><RequestorInformation><ReasonDetails><TrackingNumber>TestFromSoapUI</TrackingNumber></ReasonDetails></RequestorInformation><Detail><PolicyInformation><CoverageStatus><ResponseDetails><ResponseCode>Confirmed</ResponseCode><UnconfirmedReasonCode>3</UnconfirmedReasonCode><UnconfirmedReasonCode>2</UnconfirmedReasonCode></ResponseDetails></CoverageStatus><OrganizationDetails><NAIC/></OrganizationDetails><PolicyDetails><VerificationDate>2008-08-05T08:30:00.359-06:00</VerificationDate><UniqueKey>20096226</UniqueKey><PolicyState>WY</PolicyState></PolicyDetails></PolicyInformation></Detail></CoverageResponse></soap:Body></soap:Envelope>
The following directions and code were given to me and it worked like a champ:
The following lines of code will force XFire to build the XML prolog.
MessageContext ctx = AbstractInvoker.getContext();
ctx.setProperty(SoapSerializer.SERIALIZE_PROLOG, true);Just put this code in the method prior to returning the response.
Loyal WaterMemberThank you for posting this information.
-
AuthorPosts