SOAP HTTP状态500

时间:2016-07-20 13:04:52

标签: java http soap axis2

我正在尝试使用Axis2调用SOAP服务。 我使用axis2-wsdl2code-maven-plugin生成了javacode。

服务,我打电话用C#.net编程,服务和服务器不提供任何记录

我的代码:

FileImageInputStream fis = new FileImageInputStream(new File("C:/projekte/WorkflowPlugins/Cre_IkarosImport/data/import.xml"));
String line = fis.readLine();
StringBuilder fileContent = new StringBuilder();

while(line != null && !line.equals(""))
{
    fileContent.append(line);
    line = fis.readLine();
}

ImportServiceStub importService = new ImportServiceStub("http://win517a007:44102/Import.svc");
importService._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, "false");

importService._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, 100000);
importService._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, 100000);
importService._getServiceClient().engageModule("addressing");

DirectImportDocument importDocument = DirectImportDocument.Factory.newInstance();
DirectImportDocument.DirectImport directImport = importDocument.addNewDirectImport();
DirectImportRequest directImportRequest = directImport.addNewRequest();
directImportRequest.setData(fileContent.toString());

importService.directImport(importDocument);
importService._getServiceClient(); 

但每次,我都会尝试导入我抛出的文件:

org.apache.axis2.AxisFault: The message could not be processed. This is most likely because the action 'http://tempuri.org/IImportService/DirectImport' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:508)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:368)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:414)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
at de.crefo.workflow.ikarosimport.wsdl.ImportServiceStub.directImport(ImportServiceStub.java:988)
at de.crefo.workflow.ikarosimport.actions.IkarosImport.importFile(IkarosImport.java:66)
at de.crefo.workflow.ikarosimport.actions.IkarosImport.main(IkarosImport.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

由状态500“内部服务器错误”引起的问题我发现了

这不是暂停,即时抛出异常

如果您需要任何进一步的信息,请告诉我

0 个答案:

没有答案