Provide schema for xsd:any element while importing WSDL using wsimport
I have a WSDL that uses an xsd:any element in a return type for one of the
methods, like this:
<xs:element name="Method_XMLResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Method_XMLResult">
<xs:complexType mixed="true">
<xs:sequence>
<xs:any/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
When I run the WSDL through the wsimport tool, I get a generated class
that has this xs:any field mapped as a list of objects:
public static class MethodXMLResult {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
}
When invoking the service using the generated code, I get instances of
org.w3c.dom.Node in the content list
(com.sun.org.apache.xerces.internal.dom.ElementNSImpl to be precise) that
I would need to parse myself. I was, however, provided with a separate,
external schema document for the objects actually returned - and I'm
trying to somehow feed it to wsimport so it generates the classes for them
as well.
I'm trying to accomplish that through JAX-WS / JAXB customization file
like this:
<jaxws:bindings xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:a="http://www.w3.org/2001/XMLSchema"
wsdlLocation="wsdlLocation.wsdl">
<jaxws:bindings node="wsdl:definitions">
<jaxws:bindings node="wsdl:types"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
<jaxws:bindings
node="//s:schema[@targetNamespace='wsNamespace']">
<jaxb:bindings
node="//s:element[@name='Method_XMLResponse']//s:any">
...
</jaxb:bindings>
</jaxws:bindings>
</jaxws:bindings>
</jaxws:bindings>
</jaxws:bindings>
Looks like wsimport picks the right location to customize (gave me
numerous error meesages with properly designated line number in the WSDL),
but I can't figure out how to fill the <jaxb:bindings> element to make
wsimport generate classes from the external schema. Is it even possible?
Any help would be much appreciated.
Tuesday, 17 September 2013
Spinner layout refresh in expanded list
Spinner layout refresh in expanded list
I have spinner in my extended list. What I would like to refresh layout of
spinner after button is clicked. I am successful at refreshing its state
to "0" position, but user still sees old value.
What I would like to know:
It is possible to recreate layout in expanded list?
How to refresh spinner layout, so user would see change and would not need
to scroll down and up for that
Maybe a little bit of topic. It is possible to have one spinner in
expanded list with different values on each child of expanded list? In
example:
Test1
sub1 SpinnerValue1
sub2 SpinnerValue2
I have spinner in my extended list. What I would like to refresh layout of
spinner after button is clicked. I am successful at refreshing its state
to "0" position, but user still sees old value.
What I would like to know:
It is possible to recreate layout in expanded list?
How to refresh spinner layout, so user would see change and would not need
to scroll down and up for that
Maybe a little bit of topic. It is possible to have one spinner in
expanded list with different values on each child of expanded list? In
example:
Test1
sub1 SpinnerValue1
sub2 SpinnerValue2
Cant pause audio during applicationDidEnterBackground
Cant pause audio during applicationDidEnterBackground
I cant change the values or alter any variables or objects declared. Can
anyone see whats wrong?
In my app delegate method..
- (void)applicationDidEnterBackground:(UIApplication *)application
{
MainPage *mp = [[MainPage alloc]init];
mp.newTime = [[NSDate date] timeIntervalSinceDate:mp.date];
[mp.timer invalidate];
mp.switchT = 1;
mp.playBarButton.enabled = YES;
mp.pauseBarButton.enabled = NO;
mp.stopBarButton.enabled = YES;
[mp.avPlayer pause];
}
None of these actions above are executed..In my mainpage.h file I have the
followed declared like this
@property (nonatomic, retain) AVAudioPlayer *avPlayer;
@property (strong, retain) NSTimer *timer;
@property (strong, retain) NSDate *date;
@property (nonatomic) NSTimeInterval newTime;
@property (nonatomic) NSInteger switchT;
@property (strong, nonatomic) IBOutlet UIBarButtonItem *playBarButton;
@property (strong, nonatomic) IBOutlet UIBarButtonItem *pauseBarButton;
@property (strong, nonatomic) IBOutlet UIBarButtonItem *stopBarButton;
Of coarse in my implementation file these are synthesized and all works
well with my code within mainpage.m just not in my appDelegate file can
anyone see the problem? Note this is a fully functioning app everything
works well just can't execute the following code in my
applicationDidEnterBackground method and im assuming its the way my
properties are made? Also no errors with my code written in the app
delegate.
I cant change the values or alter any variables or objects declared. Can
anyone see whats wrong?
In my app delegate method..
- (void)applicationDidEnterBackground:(UIApplication *)application
{
MainPage *mp = [[MainPage alloc]init];
mp.newTime = [[NSDate date] timeIntervalSinceDate:mp.date];
[mp.timer invalidate];
mp.switchT = 1;
mp.playBarButton.enabled = YES;
mp.pauseBarButton.enabled = NO;
mp.stopBarButton.enabled = YES;
[mp.avPlayer pause];
}
None of these actions above are executed..In my mainpage.h file I have the
followed declared like this
@property (nonatomic, retain) AVAudioPlayer *avPlayer;
@property (strong, retain) NSTimer *timer;
@property (strong, retain) NSDate *date;
@property (nonatomic) NSTimeInterval newTime;
@property (nonatomic) NSInteger switchT;
@property (strong, nonatomic) IBOutlet UIBarButtonItem *playBarButton;
@property (strong, nonatomic) IBOutlet UIBarButtonItem *pauseBarButton;
@property (strong, nonatomic) IBOutlet UIBarButtonItem *stopBarButton;
Of coarse in my implementation file these are synthesized and all works
well with my code within mainpage.m just not in my appDelegate file can
anyone see the problem? Note this is a fully functioning app everything
works well just can't execute the following code in my
applicationDidEnterBackground method and im assuming its the way my
properties are made? Also no errors with my code written in the app
delegate.
ASP.NET MVC 4 Entity Framework pointing to an embedded SQL Server database
ASP.NET MVC 4 Entity Framework pointing to an embedded SQL Server database
I have a web application that is being build from ASP.NET MVC 4 internet
application pattern. This web application is using a SQL Server database,
obviously I need to have SQL Server installed.
I would like to know if it is possible and not difficult to modify the
logic that comes with ASP.NET MVC 4 internet application pattern to point
to an embedded SQL Server database instead of using the typical SQL Server
database to which is attached to. I need this because I need to publish
this application in a machine that has not installed SQL Server and I
wonder if it is possible to use an embedded SQL Server database and avoid
having installed SQL Server on the machine.
Is it possible? If so, how to do that?
I have a web application that is being build from ASP.NET MVC 4 internet
application pattern. This web application is using a SQL Server database,
obviously I need to have SQL Server installed.
I would like to know if it is possible and not difficult to modify the
logic that comes with ASP.NET MVC 4 internet application pattern to point
to an embedded SQL Server database instead of using the typical SQL Server
database to which is attached to. I need this because I need to publish
this application in a machine that has not installed SQL Server and I
wonder if it is possible to use an embedded SQL Server database and avoid
having installed SQL Server on the machine.
Is it possible? If so, how to do that?
Sunday, 15 September 2013
How can I limit the amount of characters between a newline?
How can I limit the amount of characters between a newline?
I have a textarea that should only have 50 characters per line. I found a
way to automatically add a newline after a user has typed 50 characters
$('#textarea').keyup(function (e) {
if ($(this).val().length % 50 == 0 && $(this).val().length > 0) {
$(this).val($(this).val() + '\n');
}
})
but this doesn't cover text that is pasted into the textarea. How can I
simply prevent there from ever being more than 50 characters between every
'\n' in the textarea? In other words, I want to have a fixed limit of 50
characters per line.
I have a textarea that should only have 50 characters per line. I found a
way to automatically add a newline after a user has typed 50 characters
$('#textarea').keyup(function (e) {
if ($(this).val().length % 50 == 0 && $(this).val().length > 0) {
$(this).val($(this).val() + '\n');
}
})
but this doesn't cover text that is pasted into the textarea. How can I
simply prevent there from ever being more than 50 characters between every
'\n' in the textarea? In other words, I want to have a fixed limit of 50
characters per line.
How to use Javascript in Visual Studio 2012 Ultimate and General Visual Studio
How to use Javascript in Visual Studio 2012 Ultimate and General Visual
Studio
I am very new to Visual Studio and I can code a few things in javascript
my problem is I do not know how to get the javascript to run so I can make
sure it works also I have no idea what debugging does. I have hit start
debugging with google chrome and I kept getting error 403 with iis 8.0 I
then switched the server to the visual studio default server and all it
did was show the text with headers and nothing ran. I would like it to run
kinda in console the way codeaccademy does it. I know these are some
simple questions but I have spent two days trying to get it to work. Also
any help with visual studio 2012 ultimate would be good because I could
not find any tutorials.
Studio
I am very new to Visual Studio and I can code a few things in javascript
my problem is I do not know how to get the javascript to run so I can make
sure it works also I have no idea what debugging does. I have hit start
debugging with google chrome and I kept getting error 403 with iis 8.0 I
then switched the server to the visual studio default server and all it
did was show the text with headers and nothing ran. I would like it to run
kinda in console the way codeaccademy does it. I know these are some
simple questions but I have spent two days trying to get it to work. Also
any help with visual studio 2012 ultimate would be good because I could
not find any tutorials.
Using Boost.python in Visual Studio 2008
Using Boost.python in Visual Studio 2008
I am in a HUGE depression now! I spend 2 days trying to use boost.python .
PLEASE guide me! I will explain what I did.
I have Winows 7 64 bit. The Python is 64 bit 2.7.3 installed at
C:\Python27_amd64.
Now, I take boost_1_54_0.zip and unzip in F: directory. The I use cmd.
bootstrap
this creates project-config.jam. I edit it and insert
using msvc : 9.0 ; using python : 2.7 : C:\Python27_amd64\python :
C:\Python27_amd64\include : C:\Python27_amd64\libs ;
Now i do
.\b2
This process runs for 20 something minutes and I am told that boost has
successfully been build.
After that I install boost binaries from
http://sourceforge.net/projects/boost/files/boost-binaries/ The binaries
get installed in C:\local\boost_1_54_0.
Now I want to create a General project.
Now, I use the code given for embedding python in C++ here
#include <boost/python.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <iostream>
namespace py = boost::python;
using namespace std;
int main()
{
// Initialize the interpreter
Py_Initialize();
py::object main_module = py::import("__main__");
py::object main_namespace = main_module.attr("__dict__");
py::exec("print 'Hello, world'", main_namespace);
py::exec("print 'Hello, world'[3:5]", main_namespace);
py::exec("print '.'.join(['1','2','3'])", main_namespace);
}
I setup the header files and library in VC++ directories to
F:\boost_1_54_0\boost_1_54_0 and F:\boost_1_54_0\boost_1_54_0\stage\lib
respectively.
I also setup project-->properties-->configuration
properties-->C/C++-->General-->Additional Include directories to
C:\Python27_amd64\include
Likewise, I also setup project-->properties-->configuration properties-->
Linker--> General to
C:\Python27_amd64\libs;"C:\local\boost_1_54_0\lib64-msvc-9.0" .
Now when I compile using x64 debugger. It gives me an error
Unhandled exception at 0x00000000 in test8.exe: 0xC0000005: Access
violation at location 0x0000000000000000.
I am struck since last 2 days...but thats the closest I have been since
then. please help me!
I am in a HUGE depression now! I spend 2 days trying to use boost.python .
PLEASE guide me! I will explain what I did.
I have Winows 7 64 bit. The Python is 64 bit 2.7.3 installed at
C:\Python27_amd64.
Now, I take boost_1_54_0.zip and unzip in F: directory. The I use cmd.
bootstrap
this creates project-config.jam. I edit it and insert
using msvc : 9.0 ; using python : 2.7 : C:\Python27_amd64\python :
C:\Python27_amd64\include : C:\Python27_amd64\libs ;
Now i do
.\b2
This process runs for 20 something minutes and I am told that boost has
successfully been build.
After that I install boost binaries from
http://sourceforge.net/projects/boost/files/boost-binaries/ The binaries
get installed in C:\local\boost_1_54_0.
Now I want to create a General project.
Now, I use the code given for embedding python in C++ here
#include <boost/python.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <iostream>
namespace py = boost::python;
using namespace std;
int main()
{
// Initialize the interpreter
Py_Initialize();
py::object main_module = py::import("__main__");
py::object main_namespace = main_module.attr("__dict__");
py::exec("print 'Hello, world'", main_namespace);
py::exec("print 'Hello, world'[3:5]", main_namespace);
py::exec("print '.'.join(['1','2','3'])", main_namespace);
}
I setup the header files and library in VC++ directories to
F:\boost_1_54_0\boost_1_54_0 and F:\boost_1_54_0\boost_1_54_0\stage\lib
respectively.
I also setup project-->properties-->configuration
properties-->C/C++-->General-->Additional Include directories to
C:\Python27_amd64\include
Likewise, I also setup project-->properties-->configuration properties-->
Linker--> General to
C:\Python27_amd64\libs;"C:\local\boost_1_54_0\lib64-msvc-9.0" .
Now when I compile using x64 debugger. It gives me an error
Unhandled exception at 0x00000000 in test8.exe: 0xC0000005: Access
violation at location 0x0000000000000000.
I am struck since last 2 days...but thats the closest I have been since
then. please help me!
Subscribe to:
Posts (Atom)