Quantcast
Channel: Spring Community Forums - Web Services
Viewing all 278 articles
Browse latest View live

Rutile Titanium Dioxide

$
0
0
Rutile Titanium Dioxide R218 is produced by Sulphate Process, with high dispersibility, super durability, high opacity and stability
Application:
Rutile Grade R 218 is widely used in Paint & Coating, Plastic, Ink and Paper industries.

propylene glycol
Propylene glycol Uses:
Propane-1,2-diol is the raw material for preparing unsaturated polyester resin, plasticizer, surface active agent, emulsifying agent and demulsifying agent. Propylene glycol food grade can also be used as mould inhibitor, antiseptic for fruit, ice inhibitor and moisture preserving agent for tobacco.

Uv-p

$
0
0
Features and Uses:
Tinuvin P is high efficient ultraviolet absorbent, UV-P can adsorb the UV ray of 290-400 polymethyl methacrylate, polythene, ABS resin, epoxy resin, fiber resin or used in colorless transparent products. Dosage thin product 0.1-0.5%, thick product 0.05-0.2%. 2-(2'-Hydroxy-5'-methylphenyl) benzotriazole can be used in the food container.

Lavender Essential Oil
Use: After cleaning, take proper amount of lavender essential oil applied to skin, then gently massage to absorption.
Note: Do the skin test, prohibit oral administration and avoid entering the eye.

anti rust additive

$
0
0
The water-based rust inhibitor (dehydration rust inhibitors) produced by adding LS-403 B antirust additives can form a chemical anti-corrosion film on the metal surface, thus has an excellent capacity of anti-corrosion and anti-wet. This antirust additives is the one of the best raw material choice when preparing ferrous metals or Non-ferrous water-based rust inhibitor.

UV-P
Features and Uses:
Tinuvin P is high efficient ultraviolet absorbent, UV-P can adsorb the UV ray of 290-400 polymethyl methacrylate, polythene, ABS resin, epoxy resin, fiber resin or used in colorless transparent products. Dosage thin product 0.1-0.5%, thick product 0.05-0.2%. 2-(2'-Hydroxy-5'-methylphenyl) benzotriazole can be used in the food container.

Irganox B215

$
0
0
Characteristics and uses:
Irganox B215 is an antioxidant with good performance, wnameely applied to polyethylene, polypropylene, polyoxymethylene, ABS resin, PS resin, PVC, PC, binding agent, rubber, petroleum etc. It has outstanding processing stability and long-term protection effects to polyolefine. Through the concerted effect of irganox 1010 and irganox 168, the thermal degradation and oxnameization degradation can be effectively inhibited.

Lavender Essential Oil
Use: After cleaning, take proper amount of lavender essential oil applied to skin, then gently massage to absorption.
Note: Do the skin test, prohibit oral administration and avoid entering the eye.

solid glass microspheres

$
0
0
Solid Glass Microspheres also called solid glass beads are glass solid spheres whose diameters are micro.The glass, composed of Si,Na and Ca, are broken and calcined by high temperature after which the said microspheres are obtained. With properties of the high roundness rate, better hardness, excellent anti-friction and direct reflect light,etc, Solid Glass Microsphere is widely applied in the fields of plastic rubber,abrasion ground,blast derusting,road-reflect dope and handicraft lamp,etc.

hollow glass microspheres
They give syntactic foam its light weight, low thermal conductivity, and a resistance to compressive stress that far exceeds that of other foams. These properties are exploited in the hulls of submersibles and deep-sea oil drilling equipment, where other types of foam would implode.

sodium phosphate

$
0
0
Monosodium Phosphate MSP Application:
Monosodium phosphate is used as PH buffer, characteristic improving agent, emulsification agent, nutritional supplement, antioxidizer brine penetrable agent, sugar clarifier, stabilizer, coagulant, fowl depilatory agent.

DSP sodium phosphate dihydrate
Disodium Phosphate Application:
Disodium phosphate is used in Cream of Wheat to quicken cook time, as described on the ingredients panel of the product package.Disodium phosphate is used in conjunction with trisodium phosphate in many steam-boiler applications. It supplies the inventory of free phosphates to retard calcium scale formation.Monobasic sodium phosphate and dibasic sodium phosphate is used as a saline laxative to treat constipation or to clean the bowel before a colonoscopy.

DSP sodium phosphate dihydrate

$
0
0
Disodium Phosphate Application:
Disodium phosphate is used in Cream of Wheat to quicken cook time, as described on the ingredients panel of the product package.Disodium phosphate is used in conjunction with trisodium phosphate in many steam-boiler applications. It supplies the inventory of free phosphates to retard calcium scale formation.Monobasic sodium phosphate and dibasic sodium phosphate is used as a saline laxative to treat constipation or to clean the bowel before a colonoscopy.

sodium phosphate
Monosodium Phosphate MSP Application:
Monosodium phosphate is used as PH buffer, characteristic improving agent, emulsification agent, nutritional supplement, antioxidizer brine penetrable agent, sugar clarifier, stabilizer, coagulant, fowl depilatory agent.

sodium hexametaphosphate SHMP

$
0
0
Usage:Sodium hexametaphosphate used as water-conservative. Applied to can, fruit drinks, milk product, vegetable protein drinks, instant noodles, meat product, and so on. SHMP sodium hexametaphosphate used as stabilizer and freezing agent and applied to
Packing:25 kg/bag inner plastic and outer plait

DSP sodium phosphate dihydrate
Disodium Phosphate Application:
Disodium phosphate is used in Cream of Wheat to quicken cook time, as described on the ingredients panel of the product package.Disodium phosphate is used in conjunction with trisodium phosphate in many steam-boiler applications. It supplies the inventory of free phosphates to retard calcium scale formation.Monobasic sodium phosphate and dibasic sodium phosphate is used as a saline laxative to treat constipation or to clean the bowel before a colonoscopy.

dimethyl sulphate

$
0
0
Colorless or yellowish transparent liquid, inflammable and toxic. Dimethyl Sulfate is slightly soluble in water, soluble in aloe when the temperature rises up or exists acid and alkali, hydrolysis speeds up place ammonolysis. Its steam has the odor of onion and strong corrosiveness to pungency to eyes, mucous membrane and respiratory system, affects the function kidney, heart, lung central nervous system, even leads to death.

methanesulfonic acid
Application:
Methane Sulfonic Acid can be used as solvent, catalyst of alkylation, esterification and polymerization etc., 99% MSA mainly used in pharmaceutical industry, while 70% MSA mainly used in electric plating and other electronic industry.

methanesulfonic acid

$
0
0
Application:
Methane Sulfonic Acid can be used as solvent, catalyst of alkylation, esterification and polymerization etc., 99% MSA mainly used in pharmaceutical industry, while 70% MSA mainly used in electric plating and other electronic industry.

methanesulfonyl chloride
Application:
Methanesulfonyl Chloride can be used as catalyst, chlorinating agent, firming agent, stabilizer or as an intermediate for dyes, pharmaceuticals and pesticides.

DMDS suppliers

$
0
0
Application:
Dimethyl Disulfide can be used as an activator in hydrodesulfurization process of oil refinery, and in resulfurization process, dimethyl disulphide also can be used as an inhibitor in cracking coking of petrochemicals, also an intermediate for solvent and pesticides.
methanesulfonic acid
Application:
Methane Sulfonic Acid can be used as solvent, catalyst of alkylation, esterification and polymerization etc., 99% MSA mainly used in pharmaceutical industry, while 70% MSA mainly used in electric plating and other electronic industry.

Communications management with PasswordDigest (WSPasswordCallback from WSS4J)

$
0
0
Scenario:

We are developing a Java library to deploy an authentication subsystem, which acts as an intermediary of two end-points: an originator program (which sends us the SOAP message, made by the client, as a CallbackHandler implementation) and a WebService (based on CXF, which will validate de user&password given).

Here it is a logical diagram of the system:

Code:

|------|            |-------|           
|Client|--SOAP msg->|Program|
|------|            |-------|           
                      |          |--------| 
                      \-Callback->|Java Lib|
                                  |--------|                           
                                    |            |--|                |----|
                                    \-User&Pass-->|WS|<-(validation)->|LDAP|
                                                  |--|  SOAP msg    |----|

As a is seen in other other implementations the code (to be added in our Java Lib) should be the next (taking into account that the type of the password, for -obviously- security reasons, is "PasswordDigest" (seen in the OASIS UserName Token specification, lines 196-197)):

Code:

        if (callbacks[i] instanceof WSPasswordCallback) {
            WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
            sString login = pc.getIdentifier();
            String password = getPassword(login);
            pc.setPassword(password);
        }

The line
Code:

"String password = getPassword(login);"
requires the local storage of a file (or a DB) in order to the user&pass maintenance and its subsequent check-up.

So, and that is the obstacle, we are NOT allowed to maintain that file. In addition, the WebService only provides an authentication service (yes/no to an user and password given) and we don't have any other access to the originator Program or to the client.

Any idea of how we should proceed?

Thanks in advance.

restTemplate could not find message converter -- but this time it could be a bug

$
0
0
I have been using spring's restTemplate for while, but just learned a small lesson over the weekend. In fact, I think this is a bug, but like to hear experts' advice. Here is what happened.

I defined a simple java Class:

Code:

public class WebAccount extends ActivityStatus {
        private int account_id=0;
        private String login="";
        private String password="";
        private Boolean is_business=false;
        private Boolean issue_invoice=false;
        private int biller_id=0;
        private Boolean receive_invoice=true;
        private int receiver_id=0;
        private String fname="";
        private String lname="";
        private String phone_number="";
        private String email="";
        private String addr_street1="";
        private String addr_street2="";
        private String addr_city="";
        private String addr_state="";
        private String addr_zip="";
        private String business_name1="";
        private String business_name2="";
        private String business_name3="";

        … getters and setters of all attributes...
        }

In the application, a method calls restTemplate, which returns a WebAccount:

Code:

public WebAccount myProfilePage(WebKeys web_keys) {
                String url = url_root + "myProfilePage/" + web_keys.getAccount_id();
                logger.info("url: " + url);       
                WebAccount web_account = (WebAccount) restTemplate.getForObject(url, WebAccount.class);

                return web_account;
        }

The url points to a web service, defined by Spring's restFUL annotation, which is in separate body of codes:
Code:

        @RequestMapping(value="myProfilePage/{acct_id}",method=RequestMethod.GET,produces="application/json")
        public @ResponseBody
        WebAccount myProfilePage(@PathVariable("acct_id") int account_id) {
        …
        }

Back to the method "myProfilePage": just to be sure, I logged the url, and pasted it in a web browser. It returned a correct result. However, The restTemplate command in the method generated the following error message in test runs:

org.springframework.web.client.RestClientException : Could not extract response: no suitable HttpMessageConverter found for response type [org.SandRiver.WebGateway.WebAccount] and content type [application/json]

However, I do have a json message converter for restTemplate, defined in applicationContext.xml:
Code:

  <bean id="restTemplate" class="org.springframework.web.client.RestTemplate" scope="prototype">
        <property name="messageConverters">
            <list>
                <bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter"/>
                <bean class="org.springframework.http.converter.FormHttpMessageConverter" />
                <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"/>
            </list>
        </property>
    </bean>

Eventually, I found out the following: in class WebAccount definition, if I remove setters for all 3 attributes of Boolean type (is_business, issue_invoices, receive_invoices), then everything is OK. Any setter for one of these attributes will bring out this exception.

Did I do anything inappropriate, or is this a bug?

Regards,

John Zhu

SOAP Authentication

$
0
0
Hi,

First of all I have little exeperience with web services... I have a web application that has the following security configuration:

Code:

        <sec:http auto-config='true'>
                <sec:intercept-url pattern="/**" access="ROLE_USER" />
        </sec:http>

        <sec:authentication-manager>
                <sec:authentication-provider>
                        <sec:password-encoder hash="sha"/>
                        <sec:user-service>
                                <sec:user name="testUser"
                                        password="0bf03e7a9fbf51a59a50171d7153d13c0a47243e"
                                        authorities="ROLE_USER, ROLE_ADMIN" />
                        </sec:user-service>
                </sec:authentication-provider>
        </sec:authentication-manager>

Now, I'm developing a web-service (to handle a SOAP request) that will run together with my webapp.
How can the client authenticate in my application to send this SOAP message?

Thanks!

RestTemplate put

$
0
0
Just realized that put method of RestTemplate returns void, it should return something (like id of new resource or new path of the resource created )if new resource is created as per w3c http put definition, am I correct? is this something wrongly interpreted?

http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
Excerpt from above URL:
The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI. If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate successful completion of the request. If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be given that reflects the nature of the problem. The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a 501 (Not Implemented) response in such cases.

If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those entries SHOULD be treated as stale. Responses to this method are not cacheable.

The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations. In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires that the request be applied to a different URI,

it MUST send a 301 (Moved Permanently) response; the user agent MAY then make its own decision regarding whether or not to redirect the request.

Rest Tempalte (POST)

$
0
0
Hello;
can someone show me how to use RestTemplate in order to execute this post request in server;
curl -i -X POST --data "sessionKey=eec8ff46-aaf9-485f-a7b5-452c1d7197d0&path=/contenthubfeedtest&recursive=true" http://localhost:8080/cmsadapter/contenthubfeed

Thanks;

Unexpected end of file after null

$
0
0
Hi,

this is my first time with ws and am facing a problem with it,

here is my endpoint:
Code:

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
 
import com.blueoss.cis.services.PartnersService;
import com.visionoss.api.core.v8_1.transaction.TransactionStatusResponse;
 
@Endpoint
public class VOSSAsyncNotificationEndpoint {
 
    @Autowired
    private PartnersService partnersService;
   
    public VOSSAsyncNotificationEndpoint() {
                // TODO Auto-generated constructor stub
        }
 
    @PayloadRoot(namespace="http://127.0.0.1:8888/ws/webservices/8.1/asyncNotification/", localPart="transactionStatusNotification")
    public void transactionStatusNotification(@RequestPayload TransactionStatusResponse result) {
            System.out.println("Phase: " + result.getPhase());
        System.err.println("ExternalTransactionUUID: " + result.getExternalTransactionUUID());
    }
 
}


here is web.xml

Code:

       
<servlet>
        <servlet-name>spring-ws</servlet-name>
        <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
                <init-param>
                        <param-name>contextConfigLocation</param-name>
                        <param-value>/WEB-INF/spring-ws-servlet.xml</param-value>
                </init-param>
                <init-param>
            <param-name>transformWsdlLocations</param-name>
            <param-value>true</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>spring-ws</servlet-name>
        <url-pattern>/ws/*</url-pattern>
    </servlet-mapping>

here is spring config:

Code:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sws="http://www.springframework.org/schema/web-services"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        <context:component-scan base-package="com.blueoss.cis.ws" />
        <sws:annotation-driven />
        <!-- <sws:dynamic-wsdl id="asyncNotificationWS" portTypeName="asyncNotification"
                serviceName="transactionStatusNotification" locationUri="/ws_services/" targetNamespace="http://webservice.api.visionoss.com/v8_1/asyncNotification/"
                createSoap11Binding="true" requestSuffix="Response"> <sws:xsd location="/WEB-INF/asyncNotification.xsd"
                /> </sws:dynamic-wsdl> -->

        <bean
                class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
                <property name="marshaller" ref="marshaller" />
                <property name="unmarshaller" ref="marshaller" />
        </bean>

        <bean id="marshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller">
        </bean>

        <bean id="asyncNotification-schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
                <property name="xsd" value="/WEB-INF/wsdl/asyncNotification.xsd">
                </property>
        </bean>

        <sws:static-wsdl id="asyncNotification" location="/WEB-INF/wsdl/asyncNotification.wsdl" />

</beans>

and wsdl:

Code:

<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net.
        RI's version is JAX-WS RI 2.2.1-hudson-28-. -->
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:tns="http://webservice.api.visionoss.com/v8_1/asyncNotification/"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:txn="http://v8_1.core.api.visionoss.com/transaction/" name="notificationWebService"
        targetNamespace="http://127.0.0.1:8888/ws/webservices/8.1/asyncNotification/">

        <wsdl:types>
                <xsd:schema
                        targetNamespace="http://127.0.0.1:8888/ws/webservices/8.1/asyncNotification/">
                        <xsd:import namespace="http://v8_1.core.api.visionoss.com/transaction/"
                                schemaLocation="syncNotification.xsd" />

                        <xsd:element name="transactionStatusResponse" type="txn:transactionStatusResponse" />
                </xsd:schema>
        </wsdl:types>

        <wsdl:message name="transactionStatusResponse">
                <wsdl:part element="tns:transactionStatusResponse" name="result" />
        </wsdl:message>

        <wsdl:portType name="asyncNotification">
                <wsdl:operation name="transactionStatusNotification">
                        <wsdl:input message="tns:transactionStatusResponse" />
                </wsdl:operation>
        </wsdl:portType>

        <wsdl:binding name="asyncNotificationSoap" type="tns:asyncNotification">
                <soap:binding style="document"
                        transport="http://schemas.xmlsoap.org/soap/http" />
                <wsdl:operation name="transactionStatusNotification">
                        <soap:operation soapAction="transactionStatusNotification" />
                        <wsdl:input>
                                <soap:body use="literal" />
                        </wsdl:input>
                </wsdl:operation>
        </wsdl:binding>

        <wsdl:service name="asyncNotification">
                <wsdl:port binding="tns:asyncNotificationSoap" name="asyncNotificationSoap">
                        <soap:address
                                location="http://127.0.0.1:8888/ws/webservices/8.1/asyncNotification" />
                </wsdl:port>
        </wsdl:service>

</wsdl:definitions>

I can open the wsdl file on http://127.0.0.1:8888/ws/webservices...ification.wsdl

but I get the following error on soapui:

Code:

Error loading [http://127.0.0.1:8888/ws/webservices/8.1/syncNotification.xsd]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: Unexpected end of file after null
also if I try to open the xdd wit a post request I get:

Code:

500 Could not create message from InputStream: Invalid Content-Type:text/plain. Is this an error message instead of a SOAP response?; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/plain. Is this an error message instead of a SOAP response?
can anyone help me please??

Thanks in advance.

Premature end of file in Webservice Template-Webservice client

$
0
0
Hi,
I am trying to invoke soap service using webservice client and I am geting a premature end of file exception. This is working fine from SOAP UI and sample java client. Below is the trace. I am not sure whether it is expecting any header.


org.springframework.ws.client.WebServiceIOExceptio n: I/O error: Unexpected end of file from server; nested exception is java.net.SocketException: Unexpected end of file from server
at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:543)
at org.springframework.ws.client.core.WebServiceTempl ate.doSendAndReceive(WebServiceTemplate.java:492)
at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:436)
at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:427)
at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:417)
at com.test.client.WebServiceClient.simpleSendAndRece ive(WebServiceClient.java:58)
at com.test.client.TestClient.testItemLookup1(TestCli ent.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runRefle ctiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallabl e.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExpl osively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod .evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.e valuate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.ev aluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentR unner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRu nner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRu nner.java:173)
at org.junit.internal.runners.statements.RunBefores.e valuate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.ev aluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.ja va:220)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:197)
Caused by: java.net.SocketException: Unexpected end of file from server
at sun.net.http://www.http.HttpClient.parseHTTP...nt.jav a:774)
at sun.net.http://www.http.HttpClient.parseHTTP...ient.java:633)
at sun.net.http://www.http.HttpClient.parseHTTP...nt.jav a:771)
at sun.net.http://www.http.HttpClient.parseHTTP...ient.java:633)
at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1195)
at java.net.HttpURLConnection.getResponseCode(HttpURL Connection.java:379)
at sun.net.http://www.protocol.https.HttpsURLCo...Impl.java:318)
at org.springframework.ws.transport.http.HttpUrlConne ction.getResponseCode(HttpUrlConnection.java:131)
at org.springframework.ws.transport.http.AbstractHttp SenderConnection.hasResponse(AbstractHttpSenderCon nection.java:64)
at org.springframework.ws.transport.AbstractSenderCon nection.createTransportInputStream(AbstractSenderC onnection.java:46)
at org.springframework.ws.transport.AbstractWebServic eConnection.receive(AbstractWebServiceConnection.j ava:86)
at org.springframework.ws.client.core.WebServiceTempl ate.doSendAndReceive(WebServiceTemplate.java:589)
at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:537)
... 30 more

Please Help! Exception:WebServiceTransportException: Not Found [404]

$
0
0
I can't seem to fix this Exception.

Here's the background.

I have a simple Spring WS Web Service that works.

I can use a tool like "POSTMAN" (plug-in to Chrome) and send this service XML requests. I then receive the correct XML Response back in POSTMAN.

All good so far.

YET....

When I try to use Spring's WebServiceTemplate, I get a 404 error on the response.

I set my defaultUri to the web service root (as I did with POSTMAN) and generated an XML Request. Note that I tested the XML Request generated in the WebServiceTemplate code and it returns a correct response in POSTMAN).

However, calling the webServiceTemplate.sendSourceAndReceiveToResult(so urce, result) call below
(Note: This Forum seems to be putting a space in the word "source" above that is not in the code)

ClientLogMessageHandler[] handler = new ClientLogMessageHandler[1];
handler[0] = new ClientLogMessageHandler();
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setDefaultUri
("http://localhost:8080/myService/"); // exactly what was entered in POSTMAN in Chrome.

System.out.println("------- webServiceTemplate ----------" + webServiceTemplate
.getDefaultUri());

String requestXML = createRequestXML();
Source source = new StringSource(requestXML); // Request XML here exactly what works in POSTMAN.
Result result = new StringResult();
webServiceTemplate.sendSourceAndReceiveToResult(so urce,result);
(Note: This Forum seems to be putting a space in the word "source" above that is not in the code)

System.out.println("--------- result --------" + result.toString());

********************************
Results in this confusing Error Stack:
********************************

org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]
at org.springframework.ws.client.core.WebServiceTempl ate.handleError(WebServiceTemplate.java:622)
at org.springframework.ws.client.core.WebServiceTempl ate.doSendAndReceive(WebServiceTemplate.java:546)
at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:496)
at org.springframework.ws.client.core.WebServiceTempl ate.doSendAndReceive(WebServiceTemplate.java:451)
at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:395)
at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:386)
at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:376)
at myServiceClient.invokeService(myServiceClient.java :49)
at myServiceClient.main(myServiceClient.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main (AppMain.java:120)


***********
***********

The referenced "myServiceClient" lines in the error stack above is just where it's calling the web service. Not helpful.

I'm baffled. There are many confused people who have left postings I've found on the Internet on this exact problem, but no solutions.

I've tried using a different version of the Spring libs, but that didn't work.

As many have posted, this problem seems nearly debug-proof. I've spent several days trying to figure out what Spring wants.

Any suggestions would be most welcome.

Thanks,

Create a SOAP message from a file

$
0
0
Hi,

I am trying to have my message factory (Axiom) create a SOAP message by reading a file.
This is my code:

Code:

File messageFile = new ClassPathResource(messageFileName).getFile();
FileInputStream messageStream = new FileInputStream(messageFile);
WebServiceMessageFactory messageFactory =
                        (WebServiceMessageFactory) getApplicationContext().getBean("messageFactory");
WebServiceMessage message = messageFactory.createWebServiceMessage(messageStream);

However, I get an exception:

Code:

AxiomSoapMessageFactory requires a TransportInputStream. Object of class [java.io.FileInputStream] must be an instance of class org.springframework.ws.transport.TransportInputStream
What do I need to do to get this to work? What concrete classes extend TransportInputStream?
Or do I need to implement my own?

Thanks.
Viewing all 278 articles
Browse latest View live