The following code fails the xml deserialization:
var query = new TermQuery();
var results = query.ExecuteQuery(context);
var r = results.Count();
Console.WriteLine(r);
I'm getting a 404 error. It looks like the resource for accessing SalesTerm queries is unavailable.
This is the request:
<?xml version="1.0" encoding="utf-8"?><TermQuery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.intuit.com/sb/cdm/v2" />
and this is the response
<html><head><title>JBoss Web/2.1.12.GA-patch-03 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Null subresource for path: https://services.intuit.com/sb/none/v2/556745565</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Null subresource for path: https://services.intuit.com/sb/none/v2/556745565</u></p><p><b>description</b> <u>The requested resource (Null subresource for path: https://services.intuit.com/sb/none/v2/556745565) is not available.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/2.1.12.GA-patch-03</h3></body></html>
Thanks!
This is a bug in the DevKit. If you look at the endpoint, the DevKit is passing 'none' as the entity type.
https://services.intuit.com/sb/none/
As a workaround, you can use DevDefined or a similar library to construct your OAuth requests and call the service directly. Here is an example:
http://pastebin.com/raw.php?i=dqTb7gFM
Related
I try to find feature by id and layer id by WFS:
const cql_filter = "&cql_filter=(id=layer202103_geom.42)";
Request looks like:
service: WFS
version: 1.0.0
request: GetFeature
typeName: layer20_geom
outputFormat: json
cql_filter: (id=layer20_geom.42)
It returns me an error:
<?xml version="1.0" ?>
<ServiceExceptionReport
version="1.2.0"
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException>
Could not parse CQL filter list.
Encountered "id =" at line 1, column 2.
Was expecting one of:
<NOT> ...
"include" ...
My full geojson looks:
{"type":"FeatureCollection","features":[{"type":"Feature","id":"layer2_geom.42","geometry":{"type":"Po...
Details : I have created on flow in MuleESB which is calling a web-service without any parameter just sending it username, password and token in a property and it is working fine.
But the second API I want to post some parameters while calling soap request but I don't know how to use it I tried to pass through set payload but no response.
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Configuration" host="webservicehostadd" port="443" doc:name="HTTP Request Configuration">
<http:basic-authentication username="username" password="pass"/>
</http:request-config>
<ws:consumer-config name="Web_Service_Consumer" wsdlLocation="https://xxxx/1.0?wsdl" service="xxx" port="xxxx" serviceAddress="https://xxxxx/1.0" connectorConfig="HTTP_Request_Configuration" doc:name="Web Service Consumer"/>
<flow name="mycustomflow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/TEST" doc:name="HTTP"/>
<set-property propertyName="APIKey" value="xxx-xxx-xxx-xxx-xxx" doc:name="Property"/>
<dw:transform-message doc:name="Transform Message" metadata:id="xxx-xxx-xxx-xxx-xxxxxxxx">
<dw:input-payload mimeType="application/xml"/>
<dw:set-payload><![CDATA[%dw 1.0
%output application/xml
%namespace ns0 http://localhost/getDetails:getDetailsWSD
---
{
ns0#getDetails: {
getDetailsOrder: {
ID: payload.ns0#getDetails.getDetailsOrder.ID,
AllData: payload.ns0#getDetails.getDetailsOrder.AllData
}
}
}]]></dw:set-payload>
</dw:transform-message>
<ws:consumer config-ref="Web_Service_Consumer" operation="employeeDetails" doc:name="Web Service Consumer"/>
</flow>
It showed the below error:
Exception while executing:
[row,col]: [1,1]
Unexpected character '{' (code 123) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1].
Updated answer:
<dw:transform-message metadata:id="XXXXX" doc:name="Transform Message">
<dw:set-payload><![CDATA[
%output application/xml skipNullOn="everywhere"
%namespace ns0 localhost/getDetails:getDetailsWSD
---
{
ns0#getDetails: {
getDetailsOrder: {
ID: payload.ns0#getDetails.getDetailsOrder.ID,
AllData: payload.ns0#getDetails.getDetailsOrder.AllData
}
}
}]]>
</dw:set-payload>
</dw:transform-message>
In your scenario: you are passing a body in XML format and sometimes an empty body in your Postman requests.
Passing an empty body results your payload to be {NullPayload}. To handle this, we have to remove explicitly defining the input mime type: <dw:input-payload mimeType="application/xml"/>.
In your transformation: ID: payload.ns0#getDetails.getDetailsOrder.ID,. You are retrieving a value from an empty payload and this will fail. To avoid failing, we have added: skipNullOn="everywhere". You can read more about it here.
I have tried the transformation myself which results to this:
<?xml version='1.0' encoding='UTF-8'?>
<ns0:getDetails xmlns:ns0="http://localhost/getDetails:getDetailsWSD">
<getDetailsOrder/>
</ns0:getDetails>
I think we are done with your initial issue regarding transformation of your empty payload. Your concern now is consuming the web service.
Thank you.
Hi I am trying to create an email template record in Dynamics CRM using SDK SOAP.Below is my code
var email_body = "ehhlo";
var email_subject = $("#subject").val();
var email_title = $("#title").val();
var templateColumns = {
"title": Sdk.String,
"subject": Sdk.String,
"languagecode": Sdk.Int,
"templatetypecode": Sdk.OptionSet,
"body": Sdk.String
};
var email = new Sdk.Entity("template");
initializeEntity(email, templateColumns);
email.setValue("title", email_title);
email.setValue("subject", email_subject);
email.setValue("languagecode", 1033);
email.setValue("templatetypecode", 1);
email.setValue("body", email_body);
try {
templateid= Sdk.Sync.create(email);
alert("Created account with id: " + templateid);
}
catch (e) {
throw new Error("Error on Create : " + e.message);
}
I have tried creating using sync and async both but I got the error
An unexpected error occurred.
On capturing the logs using Fiddler I am getting the following response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring xml:lang="en-US">An unexpected error occurred.</faultstring>
<detail><OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
<Message>An unexpected error occurred.</Message>
<Timestamp>2016-08-16T13:01:27.627155Z</Timestamp>
<InnerFault>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
<Message>System.InvalidCastException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #9F27DAAC</Message>
<Timestamp>2016-08-16T13:01:27.6427801Z</Timestamp>
<InnerFault i:nil="true"/>
<TraceText i:nil="true"/>
</InnerFault>
<TraceText i:nil="true"/>
</OrganizationServiceFault>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Now can some one please point me what I am doing wrong and why this System.InvalidCastException is generating.
Thanks
It's erroring on the cast of templatetypecode which isn't an OptionSet you should be passing the entity name here (so you'd pass "account" instead of 1).
I am trying to connect to the server from jaspersoft studio (or ireport) and while doing this I am getting following error message:
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (404)Not Found
faultActor:
faultNode:
faultDetail:
{}:return code: 404
<html><head><title>Apache Tomcat/6.0.26 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /jasperserver/services/repository</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/jasperserver/services/repository</u></p><p><b>description</b> <u>The requested resource (/jasperserver/services/repository) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.26</h3></body></html>
{http://xml.apache.org/axis/}HttpErrorCode:404
(404)Not Found
at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:221)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.jaspersoft.ireport.jasperserver.ws.RepositorySoapBindingStub.list(RepositorySoapBindingStub.java:336)
at com.jaspersoft.ireport.jasperserver.ws.WSClient.getVersion(WSClient.java:155)
at com.jaspersoft.studio.server.protocol.soap.SoapConnection.getServerInfo(SoapConnection.java:107)
at com.jaspersoft.studio.server.protocol.soap.SoapConnection.connect(SoapConnection.java:128)
at com.jaspersoft.studio.server.protocol.ProxyConnection.connect(ProxyConnection.java:86)
at com.jaspersoft.studio.server.WSClientHelper.checkConnection(WSClientHelper.java:82)
at com.jaspersoft.studio.server.wizard.ServerProfileWizard.connect(ServerProfileWizard.java:99)
at com.jaspersoft.studio.server.wizard.ServerProfileWizard.access$1(ServerProfileWizard.java:95)
at com.jaspersoft.studio.server.wizard.ServerProfileWizard$2.run(ServerProfileWizard.java:76)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
I clicked on icon for adding server and I gave username and password as "jasperadmin" and clicked on next and after hitting next button its showing me the above message. I am not getting the reason behind this error. Please help me to resolve this.
I got the solution. I did silly mistake. In the URL http://localhost:8080/jasperserver/ I replaced jasperserver with jasperserver-pro So that my URL look like http://localhost:8080/jasperserver-pro/. Now its working fine.
I changed URL because I ma using jasperreports-server-4.7 and in that directory name is jasperserver-pro. So I tried with it and its working fine.
I am trying to make a liftweb rest server that accepts POST requests for a small internal testing and call it through Spring framework's RestTemplate#postForObject("http://localhost:9090/api/validate/", request, String.class);. I went through Simply liftweb's Chapter 11 REST.
My RestController.scala is
13 object RestController extends RestHelper {
14 val data = LiftRules.loadResourceAsXml("/ValidationReply.xml");
21 serve {
22 case "api" :: "validate" :: _ XmlPost xml -> _ => <system>
26 <id>TEST</id>
27 <name>PILOT</name>
28 <version>1</version>
29 <ip_address>192.168.2.18</ip_address>
30 <connector>
31 <id>UPD</id>
32 </connector>
33 </system>
124 case JsonGet("api" :: "validate" :: _, _) => JString("Validated")
125 }
126 }
When I request the server with postUrl = "http://localhost:9090/api/validate", I get the not found error response
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>The Requested URL /api/validate was not found on this server</body>
</html>
When restUrl = "http://localhost:9090/api/validate", I get second api called with reply "Validated". How do I make the POST request in liftweb?
What you have is looking for a POST that is XML. As per the source,
it gets passed through A trait that defines the TestPost extractor.
Is the request a POST, has JSON or XML data in the post body and
something that expects JSON or XML in the response.
I'm not sure if you are just making the request or if you are actually sending data. But, assuming you are just making a post request, I would try posting XML in the body. Otherwise, you could try rewriting the rule using Post instead of XmlPost like:
case Post("api" :: "validate" :: Nil, req) =>
<system>
<id>TEST</id>
<name>PILOT</name>
<version>1</version>
<ip_address>192.168.2.18</ip_address>
<connector>
<id>UPD</id>
</connector>
</system>